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.

3 Dimensional Chat / How to move a 3D box with the mouse?

Author
Message
BillR
22
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 5th Nov 2003 08:45
Borrowing a piece of code from the DB forum (thanks!) which looks promising, I still don't understand how to move a 3D box with the mouse.

The box doesn't keep up with the mouse, and I don't know how to tell it to stay under the mouse.

Can someone help me understand how to do this? I think others would benefit from this also.

Thanks!

BillR.
BillR
22
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 5th Nov 2003 08:51
Sorry, here is some source code...

BillR
22
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 5th Nov 2003 09:09
I figured something out.

If I change lines 106&107 to this



It seems to work.
Genesis Rage
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 5th Nov 2003 11:27
some input... tested out the code, works fairly good, but have some things you might want to look into.

-add relativity to the mouse pointer (so when you click on the edge of the object, it moves from there, so it doesnt move the objects center to the mouse when you first click it)

-constant selection (when you click the object, it stays selected, so if you move your mouse real fast, the object will still move)

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Nov 2003 12:33
Ahh, a quick note - for the relative movement, you could just reposition the mouse to the objects screen position after clicking it, saves a little coding.


Van-B


I laugh in the face of fate!
Genesis Rage
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 5th Nov 2003 14:39
as fast as it was moving with the first code... it would take a LONG time to move stuff around

BillR
22
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 9th Nov 2003 09:29
Thanks for the feedback!

Login to post a reply

Server time is: 2025-06-27 14:49:34
Your offset time is: 2025-06-27 14:49:34