QuickTopic (SM) free message boards QuickTopic (SM) free message boards
Skip to Messages
  Sign In to access your topic list  |New Topic |My Topics|Profile
Upgrade to Pro   Customize, show pictures, add an intro, and more:   QuickTopic Pro...and check out QuickThreadSM
Topic: OpenGL
Views: 4473, Unique: 2790 
Subscribers: 2
What's
this?
Printer-Friendly Page
Subscribe to get & post, or stop messages by email Subscribe
All messages    << 11-22  10-10 of 22  1-9 >>
About these ads
Who | When
Messagessort recent-top   
Post a new message
 
Lucas Walter  10
01-22-2004 12:28 PM ET (US)
> I'm trying to rotate the camera about the cue ball in my 3d pool
> game. do u have any suggestions on how i update the camera
> position for the eye cordinates.. at the monent i'm using theta
> = theta - 0.05f;
> eyeX =
> 0.1f*((float)cos(theta));
> eyeZ =
> 10.0f*((float)sin(theta)) + 2.5f;

Up = (0,1,0) & eyeY = 0, correct? But the formula you have seems wrong: Eye is what you are looking at, so that should be the x,y,z of the cue ball, while center is where the camera is. If you were moving the camera along x & z (up and down and left and right on the table) while making eye the cue ball, the camera will move but always be looking straight at the cue ball.

To rotate in a perfect circle around the cue ball,
centerX = cueballX -r*cos(theta),
centerY = cueballY,
centerZ = cueballZ - r*sin(theta),
where r is how far the camera should be from the cue ball.
Eye =(cueballX,cueballY,cueballZ)
Up = (0,1,0).
RSS link What's this?
All messages    << 11-22  10-10 of 22  1-9 >>
QuickTopicSM message boards
Over 200,000 topics served
Learn more Frequently asked questions  Acknowledgements
What they're saying about QuickTopic
 Questions, comments, or suggestions? Contact Us
Read our use policy before beginning. We value your privacy; please read our privacy statement.
Copyright ©1999-2008 Internicity Inc. All rights reserved.