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 / Basic camera problem and one other thing...

Author
Message
Elegy
18
Years of Service
User Offline
Joined: 26th Jun 2006
Location:
Posted: 27th Jun 2006 03:42
I seem to be having a very annoying problem which I can't seem to fix. I'm creating a model which partially simulates newtonian physics and I set the camera rotation before the main loop to 110,0,162 respectively for X,Y and Z but as soon as the loop starts, it reverts back to 0,0,0 again and I seem to be stuck on how to fix this!

Also, I want to be able to add planets at all without having to manually modify the accelerations of every single other celestial body involved because it gets very tedious. Is there a way I can do this? The code I have so far is below. Some help on how to clean up the code would also be appreciated. Thank you.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Jun 2006 10:09
I don't believe the camera is going to 0,0,0. But it may still be wrong for what you want to achieve. Output the angle values to the screen to see what is happening:

TEXT 5,5, str$(camera angle x(),4)
TEXT 5,25, str$(camera angle y(),4)
TEXT 5,45, str$(camera angle z(),4)

Secondly, you're doing a lot of FIX OBJECT PIVOTing on objects that haven't been rotated. This command is only useful on objects that you want to rotate and then set the new orientation as 0,0,0



Elegy
18
Years of Service
User Offline
Joined: 26th Jun 2006
Location:
Posted: 27th Jun 2006 13:36
The camera is actually reverting back to 0,0,0 because the position and angle is already being outputted to the screen.

text 10,10,"X pos: " + str$(camera position x(1))
text 10,30,"Y pos: " + str$(camera position y(1))
text 10,50,"Z pos: " + str$(camera position z(1))
text 10,70,"X angle: " + str$(camera angle x(1))
text 10,90,"Y angle: " + str$(camera angle y(1))
text 10,110,"Z angle: " + str$(camera angle z(1))

I have narrowed down the problem to these commands:

turn camera right 1,camerax#
pitch camera up 1,rotatey#
roll camera right 1,rotatex#

When I rem these out, the camera rotatation is 110,0,162 when the main loop starts but when they are not remmed, it starts from 0,0,0. Is there someway of fixing the camera's pivot point?

And thank you for the object pivot advice. I'll have a look at it.

Login to post a reply

Server time is: 2024-11-27 15:42:15
Your offset time is: 2024-11-27 15:42:15