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 / un rolling the camera

Author
Message
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th May 2006 07:02 Edited at: 13th May 2006 07:03
Is it possible to detect the roll angle value of the camera and then roll it so that it is facing up again? I am doing an FPS, and I have my camera looking code down(so that you can rotate the camera with the mouse). My problem is that when you look down, and then move the mouse to the side, the camera becomed angled. So here is my question in a nutshell:

How can you make a slanted camera unslanted w/o using commands like yrotate camera and xrotate camera (these make the entire thing even more glitchy, already tried)?

BTW: I am using DBC

Thanks in advance
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 13th May 2006 13:05
In testing get the X/Y/Z of the camera when it is facing the right way, and put them in variables. Now you can roll the camera back to these positions whenever you want. I did it with a 3D dice program when I wanted the dice to always face the player.

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th May 2006 00:39
could you give me an example of how to do that?
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th May 2006 03:22 Edited at: 14th May 2006 03:23
Actually they aren't X/Y/Z positions, they are X/Y/Z rotation angles. This is my Dice program hacked. Pos 1,2,3 are the final angles to face the right way for the number 6 on a dice. Different Pos will give a different number on the dice. It relates in the same way to rotating a camera back to its start position. This example will need some changes for it to work in your program, but it shows you how to do it slightly.

pos1 = 270
pos2 = -270
pos3 = -270
x# = curveangle(pos1,x#,20)
y# = curveangle(pos2,y#,20)
z# = curveangle(pos3,z#,20)
cameraz# = curveangle(0,cameraz#,20)

xrotate object 41,x#

yrotate object 41,y#

zrotate object 41,z#
zrotate camera cameraz#

Login to post a reply

Server time is: 2024-11-26 21:41:15
Your offset time is: 2024-11-26 21:41:15