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 / Problem with Camera Rotation

Author
Message
GuntiNDDS
16
Years of Service
User Offline
Joined: 2nd Jan 2008
Location:
Posted: 2nd Jan 2008 19:04
Hi,

i am new to darkbasic pro and to 3d programming. to get started, i made a little program where colored boxes fall down and stack upon each other. the scene works and looks like i wanted it to.

now i want to add a little automated camera rotation around the scene. i tried using ZROTATE CAMERA for this. however, this will turn the scene out of the focus. not sure how to explain this.

You will get what i mean if you run my code below and keep pressing the Numpad 3 Key. it does the rotation and you will see what i mean with the scene getting out of focus.

GuntiNDDS
16
Years of Service
User Offline
Joined: 2nd Jan 2008
Location:
Posted: 2nd Jan 2008 19:13
i meant Numpad 1, not Numpad 3.
GuntiNDDS
16
Years of Service
User Offline
Joined: 2nd Jan 2008
Location:
Posted: 2nd Jan 2008 23:04
ok, i got it sorted using the SET CAMERA TO FOLLOW command. however, i also had to rewrite some parts of the code, because i had the oriantation completly wrong.

Please Explain !
is it true, that if i want a plain to "lay on the floor" in correct oriantation, i need to XROTATE it 180, YROTATE it 90 and ZROTATE it 90 degrees after creating it ?


for reference, new code below:

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Jan 2008 18:51
Quote: "is it true, that if i want a plain to "lay on the floor" in correct oriantation, i need to XROTATE it 180, YROTATE it 90 and ZROTATE it 90 degrees after creating it ?"


Normally it can be achieved using the code:
make object plain obj, sizex, sizey
rotate object obj, -90, 0, 0
fix object pivot obj

Secondly, to rotate the camera around a fixed point, you would want to use this:

(in the loop)


Or if you want to add a angle X

(in the loop) The stuff with the angles you can choose.


That's all. The set camera to follow command is usually used in other ways...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
GuntiNDDS
16
Years of Service
User Offline
Joined: 2nd Jan 2008
Location:
Posted: 3rd Jan 2008 20:13
ah thanks

Login to post a reply

Server time is: 2024-09-27 08:32:24
Your offset time is: 2024-09-27 08:32:24