Java OpenGL Animation

Encerrado Postado Oct 18, 2011 Pago na entrega
Encerrado Pago na entrega

Draw an analog clock using JOGL. At minimum, the clock should have a cylinder as the main body and three hands for hour, minute, and second, as shown in the attachment. The cylinder can be drawn with two circles and a set of rectangles (e.g., quad). A circle can be drawn as a set of lines. In other words, you can draw a cylinder with glLines and glQuads.

The clock should the correct time and update every second. You can use the Java FPSAnimator class to update the clock.

You are also required to use the mouse and keyboard to control the movement of the entire clock. Three types of transformations are required: translation, rotation and scale. To implement this function, the glTranslatef, glRotatef, and glScalef functions should be used. The transformation should be controlled by both keyboard and mouse:

? Translate: arrow keys and mouse movement when holding the left mouse button.

? Rotate: mouse movement when holding the right mouse button. glRotatef is defined as rotation around an axis. Only rotation around the x-aix (1, 0, 0) or the y-axis (0,1, 0) is required.

? Scale (zoom in/out): 'i' for zoom in, and 'o' for zoom out. Uniform scale should be used.

? 'r': reset the position and scale of the clock, which should be centered at the screen center (e.g., the origin of the OpenGL coordinate system).

Typically, the program should respond to mouse event to record the starting position of a mouse click, then respond to mouse motion event to obtain the delta x and y since the initial click. The delta values are used to set the amount of translation or rotation. Keep in mind that OpenGL is a state machine. It keeps track of the current transformation matrix.

All the transformation functions mentioned above are multiplied with the current matrix. If you want to keep the current matrix, you can just glPushMatrix (and glPopMatrix) to record a copy in the OpenGL matrix stack, which is usually at least 32 levels deep. See the sample program for

example.

Getting Started:

A skeletal program on the class web page is supplied to get you started. In the skeleton program

a 2D clock is drawn for you. It is also rotating around the y-axis. Uncomment the line with

"OGL_STACK" (there are two lines) and see the difference in the output.

Engenharia Arquitetura de software Teste de Software Artes Visuais

ID do Projeto: #3640572

Sobre o projeto

5 propostas Projeto remoto Ativo em Nov 9, 2011

5 freelancers estão ofertando em média $90 nesse trabalho

repmovsd

See private message.

$102 USD in 6 dias
(143 Comentários)
7.0
GraphicsApp

See private message.

$76.5 USD in 6 dias
(27 Comentários)
5.8
DonCastelano

See private message.

$102 USD in 6 dias
(28 Comentários)
4.9
pcmaster

See private message.

$68 USD in 6 dias
(7 Comentários)
3.1
jodev7

See private message.

$102 USD in 6 dias
(1 Comentário)
1.3