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 / Why does my camera angle change?

Author
Message
Relativity
20
Years of Service
User Offline
Joined: 29th Mar 2005
Location: Position is relative.
Posted: 7th May 2005 12:15
Here's the main problem: I have my program set so when the left mosue button is held down it goes inot a free camera look mode thingy. When I let go and turn the object that I base my camera off of left or right, the camera and object X angle resets to 0. Does anybody know why this happens? Here is my code:


Thanks for your help.

"It's against my programming to impersonate a deity!"~C-3P0
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 23rd May 2005 23:53
Hmm interesting. I just woke up and I am a bit sleepy, and don't have DB Classic on this machine, but I think the problem is in the lines related to:

IF MOUSECLICK()=1 AND CAMVIEW=1

or

POSITION CAMERA OBJECT POSITION X(1),OBJECT POSITION Y(1),OBJECT POSITION Z(1)
ROTATE CAMERA OBJECT ANGLE X(1),OBJECT ANGLE Y(1),OBJECT ANGLE Z(1)

or

`FREELOOK WHEN RIGHT MOUSE CLICKED
MLOOK:

POSITION MOUSE CAMVIEWX/2,CAMVIEWY/2

MLOOKX#=WRAPVALUE(MLOOKX#+MOUSEMOVEY())
MLOOKY#=WRAPVALUE(MLOOKY#+MOUSEMOVEX())
MLOOKZ#=WRAPVALUE(MLOOKZ#+MOUSEMOVEZ())

IF MLOOKX#>180 AND MLOOKX#<270 THEN MLOOKX#=270
IF MLOOKX#<180 AND MLOOKX#>90 THEN MLOOKX#=90

ROTATE OBJECT 1,MLOOKX#,MLOOKY#,MLOOKZ#

RETURN


All I can tell you for now is to double-check how are you handling the camera, and make sure, if you move the camera in a spot in the code, and THEN move it AGAIN in another spot, the camera will end up using the settings that were set when it was called -last-.

Login to post a reply

Server time is: 2025-05-22 23:49:11
Your offset time is: 2025-05-22 23:49:11