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 / Mouse look

Author
Message
ProdCake
16
Years of Service
User Offline
Joined: 11th Jul 2008
Location:
Posted: 12th Jul 2008 07:20
Is there a simple way to give the camera mouse look in code, or will i have to capture the mouse in the center of the screen and use trig to change the camera vector.
and if you can please help me with the code as well, haven't been using DarkGDK for long now.

Robot Dog
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 12th Jul 2008 19:42 Edited at: 12th Jul 2008 19:42
The absolute simplest way to do it would be:


However, that ignores a few things, such as settings limits to how far the camera can move. While generally you'd like the player to be able to spin around endlessly, it's not a good idea for the player to be able to look up and up, until they see the world upside down. One way to limit motion would be something like this:


That should work, theoretically, though I haven't tested it. 60 and -60 degrees are the assigned boundaries for up and down, though you can set them to whatever you like.


My site, for various stuff that I make.
ProdCake
16
Years of Service
User Offline
Joined: 11th Jul 2008
Location:
Posted: 12th Jul 2008 20:39
Thanks for the help, much appreciated, i will test the codes out now

Robot Dog
ProdCake
16
Years of Service
User Offline
Joined: 11th Jul 2008
Location:
Posted: 13th Jul 2008 07:17
I have tested the codes out, but i have noticed that if you move the mouse in a rotary motion, it rolls the camera, why would that be and how would you be able to fix that?

i have tried setting the z rotation of the camera to 0 before and after the mouselook codes with dbRotateCameraZ(0,0) but when i move around it starts bugging out the up down rotation, which is pretty strange

Robot Dog

Login to post a reply

Server time is: 2024-11-17 18:17:37
Your offset time is: 2024-11-17 18:17:37