Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Camera rotaing around object

Author
Message
Pyromaniac
23
Years of Service
User Offline
Joined: 8th Jan 2003
Location: United Kingdom
Posted: 15th Jun 2003 16:49 Edited at: 15th Jun 2003 16:50
Can someone please write some code to make the camera circle an object while still looking directly at it?

I've tried several diffferent methods but i cant seem to get it right

thanks!

Screw the rules! What can I blow up???
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 15th Jun 2003 17:38
here you go, looks like the cube is just rotating but it is actually the camera


hope it helps!

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL [email protected] to work on the new Star Strike project!!!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Jun 2003 21:52
If you don't need to know how the maths works, here's a piece of code that people may find useful - it gives you the rotating camera positioning that you'll see in games like Dungeon Siege.

It works by positioning the camera at the same place as the object you want to look at, arranging the camera rotation as you've specified, then moving the camera backwards into position. It relies on having the rotation order set to ZYX (which is the default anyway).

I've also added an extra object to make the rotation easier to see.

Use the cursor keys to rotate.

Pyromaniac
23
Years of Service
User Offline
Joined: 8th Jan 2003
Location: United Kingdom
Posted: 16th Jun 2003 22:31
Thanks guys those both work well ^_^

Screw the rules! What can I blow up???

Login to post a reply

Server time is: 2026-07-06 03:25:24
Your offset time is: 2026-07-06 03:25:24