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 / need help with rotation

Author
Message
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 13th Jan 2005 04:03
Hi
I need a little help with rotating my cube in a game I´m making.
Here´s the code:



The problem is, that the cube won´t rotate when i move the mouse.

What´s the problem?

Thanks


Check out PanzerGames at http://www.freewebs.com/panzergames
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Jan 2005 04:38
Try changing this around a bit.



should probably be this



or this depending on what you want.



You were never changing the camera's angles so it rotated the object the same everytime and then put the object back facing like the camera before the sync.

Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 13th Jan 2005 04:54
thanks, now it kind of works...

but now I can move the box up and down if I look up or down with the camera.
How will i make the cube stay on the ground?


Check out PanzerGames at http://www.freewebs.com/panzergames
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Jan 2005 05:06
Change this part of the code



To this or something like it.



If you want the camera to do the same then add the same code to it only using the camera angle x() instead.

Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 13th Jan 2005 05:19
err. now the camera is acting a bit weird...
It´s making a barrel roll instead of turning left or right...
I´ve made a few changes:



If you run it, I think You´ll find out what the problem is...
when I try to turn the camera, then the cube disappears out of view...

how can i make it correct, so the cube never gets out of view?
the camera should always be centered on the cube.


Check out PanzerGames at http://www.freewebs.com/panzergames
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Jan 2005 06:15
I am at work so I cna't run it. I'll check it out when I get home. But I understand now. You want a mouselook code with object movement independant of its up and down angle correct? And how far do you want the camera up over and behind the object?
If noone else fixes it for you I'll run it and reply when I get home.

Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 13th Jan 2005 18:48
yeah, I was thinking about something like that
It would be cool if the camera was about playery+5 and playerz+10 or something like that.

thanks mate


Check out PanzerGames at http://www.freewebs.com/panzergames
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Jan 2005 19:33 Edited at: 13th Jan 2005 19:40
I'm still kinda confused. Is this something like you want? If not let me know what needs to be different.



[edit] or something like this?



Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 13th Jan 2005 21:18
The first example was great!
Thanks man


Check out PanzerGames at http://www.freewebs.com/panzergames
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 14th Jan 2005 03:11
Glad you got it working.

Login to post a reply

Server time is: 2024-11-27 19:40:52
Your offset time is: 2024-11-27 19:40:52