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.

Dark GDK / Third person shooter aiming troubles

Author
Message
String
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location:
Posted: 5th Apr 2009 06:28
I'm making a third person shooter game, to test out Dark GDK but I'm having trouble with getting the player to look up and down. I just rotate the model on the Y axis and the camera follows (moving left and right), but when I attempt it on the X axis, the whole player model rotated so I tried doing it with just the camera, and it doesn't seem to work. Heres the snippet of code that I tried.



What happens when I do this, is that it works but you need to move the mouse a lot to move it and it produces a very jumpy motion. You try to move the mouse a little bit, nothing. You move it alot, it jumps a bit.

Any help?
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 5th Apr 2009 10:53
Hey, I just realized I was having the same problem as (I rotated an object and changed the camera to match), except I didn't know it because I was using a sphere to test with.

Anyway, check this out, it should help you out:




That is obviously not all of the code for moving my character, but it should be enough to fix your problem.

The problem I had in my code (once I changed it to only rotate the camera along the X-axis) was that every time I went through the game loop I had a new rotation value along the X-axis. This meant the camera would jump to where ever this new rotation value told it to. The solution was to add a second variable that would "track" all of the different rotations made along the X-axis
String
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location:
Posted: 6th Apr 2009 09:08
I don't really understand this, I tried to follow it, tailoring it a little for my game, and what turned up was an upside down camera and it always reverted back to the original position once I stopped moving the mouse.
String
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location:
Posted: 7th Apr 2009 10:24
Bump?

Login to post a reply

Server time is: 2024-09-30 23:29:15
Your offset time is: 2024-09-30 23:29:15