Old 23rd September 2002, 22:34   #1
KeatonMill
Junior Member
 
Join Date: Jul 2002
Posts: 32
3D camera positioning

Hey there guys. I've got a problem. I've been working on various asundry 3D superscopes, and I've run into a small problem. I haven't figured out raytracing yet, and I don't know if that's part of the problem or not.
I know how to rotate the points around the origin with specific angles, but what I want to do is to move the camera around a specific point, and have it always point towards that point. Obviously, I haven't figured that one out yet. ;-)
Can someone give me a hand? Thanks.
KeatonMill is offline   Reply With Quote
Old 24th September 2002, 05:26   #2
Zevensoft
Major Dude
 
Zevensoft's Avatar
 
Join Date: Apr 2002
Location: Ballarat, Australia
Posts: 529
Here's the order of transforms you need to do:

RotateObject
TranslateObject
-TranslateCamera
-RotateCamera

Try that.
Zevensoft is offline   Reply With Quote
Old 24th September 2002, 19:10   #3
dirkdeftly
Forum King
 
dirkdeftly's Avatar
 
Join Date: Jun 2001
Location: Cydonia, Mars
Posts: 2,651
Send a message via AIM to dirkdeftly
Except that 3D scopes don't use raytracing. If you just rotate the object the camera will automatically point to the origin. You can translate the object before rotation, and the camera will look at the origin, but the object will rotate around it. If you translate the object AFTER the rotation, however, the camera will be looking at the point negative to the translation, and the object will be rotating upon the origin (assuming it is centered at the origin and not translated before rotation). So if your pre-rotation translation is <0,0,0> and your pre-projection rotation is <1,0,0>, the camera will be looking at the point <-1,0,0> and the object will still be rotating upon <0,0,0> (again, assuming it is centered at the origin).

"guilt is the cause of more disauders
than history's most obscene marorders" --E. E. Cummings
dirkdeftly is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump