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 / Tilting camera during strafe

Author
Message
Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 12th Apr 2010 00:22 Edited at: 12th Apr 2010 00:23
Ok so I've been working on camera movement for my FPS. I want the camera to tilt when you strafe like in Quake 1.

camtiltmodrange equals 10



It works if the camera isn't rotated on any other axis but once you turn the camera or if you use mouse look it doesn't rotate right anymore. Any suggestions?

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Apr 2010 21:14
Try using the free-flight commands instead of the rotate commands.

Put simply, the rotate commands use Euler rotation and go out of whack at certain angles. If you turn the camera right/left or up/down instead, you shouldn't have that problem.

TDK

Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 13th Apr 2010 23:26
Are you referring to the roll and pitch commands? I never noticed them before

Thanks so much. This is an effect I've always liked in Quake.

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 15th Apr 2010 22:58
Quote: "Put simply, the rotate commands use Euler rotation and go out of whack at certain angles."


Sorry, I don't understand that, could you explain please?

Rawwrr. Sig Fail.
Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 16th Apr 2010 18:23
The issue I had was when I rotated the x axis it would change the relative position of the other axies. I could be wrong in my terminology though. I'm a bio major not a math major.

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 16th Apr 2010 23:36 Edited at: 16th Apr 2010 23:38
@Mad Nightmare: They don't actually go out of whack, it's just a problem that naturally occurs with Euler rotation and transformation order. DBPro rotates objects around the X axis first, followed by the Y, and then finally Z. What this means is that since Z is the last transformation to be applied, Z rotation will always happen around the world's Z axis. Here, you can play around with this:


Edit: Whereas using the pitch, turn, and roll commands will rotate the object around the object's local axes before the command was called.
Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 17th Apr 2010 17:21
I'm still having issues with tilting during strafing. It works when the camera is facing 0 and 180 degrees but if it is facing any other direction it tilts the wrong direction. I tried using roll with the rotation commands and I also converted it to have mouse look with the pitch and turn commands as well.

Do I need to compensate in code for the other angles and actually switch around what is causing the tilting or is there another way?

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 17th Apr 2010 23:16
@Kira Vakaan

Thanks alot I understand now, that was a great example.

Rawwrr. Sig Fail.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 18th Apr 2010 03:25
@Mad Nightmare: You're welcome

@Jaeg: Hmm... it would seem to me that the roll camera command would work. Can we see some updated code to help you out?

Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 18th Apr 2010 04:44
This was just a test so the camera wouldn't stop rolling because I hadn't set it to.



It works if your facing 0 degrees on all axes but once you start looking around the way the camera would roll would become unpredictable.

I tried doing mouse look with both the pitch and turn commands and the Euler angle commands.

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 28th Apr 2010 19:00
Any ideas what is going wrong?

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 24th May 2010 17:47
I have an idea. Is it possible to attach the camera to the collision sphere as a limb? Then if I roll the sphere would it tilt the camera correctly regardless of its angle?

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.

Login to post a reply

Server time is: 2024-11-24 15:36:19
Your offset time is: 2024-11-24 15:36:19