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.

DarkBASIC Discussion / Hmm, x value rotation...

Author
Message
flock
19
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 29th Jun 2006 19:31
Hmm, I've seem to have come across a problem with x value rotation with my camera. I've never really used 3D commands in DBC but I'm understanding fine. Just when I try to rotate my camera on the x axis it won't allow for negative value rotation. I know this is simple, but I'm stumped. How can I xrotate my camera with the upkey() and downkey() commands?

a.k.a. "flockhound"
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th Jun 2006 22:32 Edited at: 29th Jun 2006 22:33
The usual command to 'wrap' the angle values is wrapvalue()
The negative value will be wrapped between 0 and 360.
Examples: wrapvalue(-5) = 360 - 5 = 355
wrapvalue(-720) = wrapvalue(360 - 720) = wrapvalue(-360) = wrapvalue(360 - 360) = 0



It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
flock
19
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 30th Jun 2006 00:26
I just figured it out earlier. I rotated the camera 360.0 then made 360.0 ground level and subtracted from there. Thanks

a.k.a. "flockhound"
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 30th Jun 2006 12:16
Well, that's exactly what wrapvalue does. But faster...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.

Login to post a reply

Server time is: 2025-05-25 04:36:22
Your offset time is: 2025-05-25 04:36:22