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.

Author
Message
Ghost Games
18
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 11th Sep 2012 16:24
Hi all

is it possible to get a carema to rotate around an object using left and right arrow keys??

thx
New World Order
21
Years of Service
User Offline
Joined: 31st Oct 2004
Location:
Posted: 11th Sep 2012 17:41 Edited at: 11th Sep 2012 17:41
I think the "point camera" command is what you are looking for:



haven't tested the code, but pretty sure it should work
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 11th Sep 2012 18:06
the twick is to set the same position for the camera as the object, same rotation, and just "move camera" backward. this will make an illution of rotating. no need for hard math formulas..



function MoveCameraAroundObj(ObjNum as Integer,Angle as Float,Distance as Integer)
position camera object position x(ObjNum),object position y(ObjNum),object position z(ObjNum)
yrotate camera object angle y(Objnum)+Angle
move camera -Distance
endfunction


then in loop you do something like:

angle# = Leftkey()-RightKey()
MoveCameraAroundObj(1,Angle#,100)

Advanced Updater for your games!
Ghost Games
18
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 11th Sep 2012 18:28
thx for the codes think i can work something out

Login to post a reply

Server time is: 2026-07-11 03:54:55
Your offset time is: 2026-07-11 03:54:55