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 / Moving Camera Around 3d Space

Author
Message
vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 2nd Jul 2007 14:44
I've been searching for this for ages, and I can't find a decent way of doing this. What I need is a camera code that allows the user to hold the mouse button then the camera will rotate freely.

I have just been using this code:



But the problem with it is when you click anywhere but the center of the screen it will jolt the camera to that rotation, I need it to the camera to only rotate when the mouse is moved. Hope that made sense to someone.

Thanks
Existence
17
Years of Service
User Offline
Joined: 20th May 2007
Location:
Posted: 2nd Jul 2007 15:02
There You Go:
Make Object Box 1,10,10,10


Hope that Helped

Tricksy little Hobbitses! They STOLE it from us!-Gollum
vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 2nd Jul 2007 15:16
Thanks for trying. But I'm afraid the problem is still there, if you click somewhere that isn't the center of the screen the camera will instantly rotate to that position or something like that. I need it so when you click somewhere the camera will stay in it's current rotation until you move the mouse while clicking.

Thanks again
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 2nd Jul 2007 18:18 Edited at: 2nd Jul 2007 18:18
The problem you're running into, is mousemove dosent update unless it's called. So if you only call it when you're trying to move, it'll give the location between there, and the last position it was called from, or something to that effect. This fixes it:


You can also use your origional rotate camera command, either or works.
vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 2nd Jul 2007 18:54
Awesome! thanks a lot man
Aralox
17
Years of Service
User Offline
Joined: 16th Jan 2007
Location: Melbourne
Posted: 6th Jul 2007 13:14
Very nice im bookmarking this


011100000111001001100001011101100110100101101110
Roborb = [0-------------] - Planning stages

Login to post a reply

Server time is: 2024-11-25 15:37:48
Your offset time is: 2024-11-25 15:37:48