camera rotation

teapot rotating 360 degrees

Page 1 of 1

1 Replies - 253 Views - Last Post: 22 April 2010 - 10:36 PM Rate Topic: -----

#1 sribhargavi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-April 10

camera rotation

Posted 22 April 2010 - 07:40 PM

a program that will fly a 3D camera in a circle around the origin where a shaded teapot is
drawn. Use glutSolidTeapot() with the size parameter set to 1.0 to place a unit teapot at the origin. The
circle that the camera moves on should have a radius big enough so that the view of the teapot fits nicely
in your window. Use the GLUT Idle() callback to update the display to simulate animation. In Idle() a
rotation amount, say theta, is incremented by a small amount and the new camera position is calculated,
and then glutPostRedisplay() is called to invoke your programs GLUT draw() function.
A circle in 3D has one of its parameters, x, y, or z held constant. To rotate in the (x, y) plane, set z=0,
and then the x and y coordinates of the camera can be found, by trigonometry, as x = r cos(theta) and y
= r sin(theta).
Start the camera at 0 degrees, and rotate it through 360. The visual effect should be to fly around the
teapot in a circle. The teapot should be shaded. For reference look at the displaySolid() function on page
254 of the prescribed Hill and Kelley textbook and use the same materials values etc., as used in that
example.

Is This A Good Question/Topic? 0
  • +

Replies To: camera rotation

#2 Martyn.Rae  Icon User is offline

  • The programming dinosaur
  • member icon

Reputation: 540
  • View blog
  • Posts: 1,406
  • Joined: 22-August 09

Re: camera rotation

Posted 22 April 2010 - 10:36 PM

View Postsribhargavi, on 23 April 2010 - 01:40 AM, said:

A program that will fly a 3D camera in a circle around the origin where a shaded teapot is drawn. Use glutSolidTeapot() with the size parameter set to 1.0 to place a unit teapot at the origin. The circle that the camera moves on should have a radius big enough so that the view of the teapot fits nicely in your window. Use the GLUT Idle() callback to update the display to simulate animation. In Idle() a rotation amount, say theta, is incremented by a small amount and the new camera position is calculated, and then glutPostRedisplay() is called to invoke your programs GLUT draw() function.

A circle in 3D has one of its parameters, x, y, or z held constant. To rotate in the (x, y) plane, set z=0, and then the x and y coordinates of the camera can be found, by trigonometry, as x = r cos(theta) and y = r sin(theta).

Start the camera at 0° degrees, and rotate it through 360°. The visual effect should be to fly around the
teapot in a circle. The teapot should be shaded. For reference look at the displaySolid() function on page
254 of the prescribed Hill and Kelley textbook and use the same materials values etc., as used in that
example.


Congratulations, you have scored 9 out of 10 for showing us you can copy a question and post it here. No wait, I will give you an extra point for finding this site! That's 10 out of 10! Well done indeed.

Now to the problem at hand. Oh, I see there is no problem, no question asked. Now forgive me for asking some questions. Have you read the forum rules where is states we don't do your assignment for you?

[rules][/rules]

This post has been edited by Martyn.Rae: 22 April 2010 - 10:36 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1