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.

Code Snippets / [DBP] 3D Mouse

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 14th Jul 2009 01:55 Edited at: 14th Jul 2009 19:38
Probably been done a million times, but here is my version anyway.

Mouse arcs around camera instead of using linear movement.
Increase/Decrease range using mouse wheel.
Supports full camera movement/rotation (single camera only).
Self-contained code = ready to plug into any project (just call _Update_3DMouse() in main loop + no initialization needed).
Left-click interface for 3D objects: Pick up and move 3D objects with the 3D mouse.
Height bar indicator (each bar is 1 DBP unit).
Provide MouseGroundHeight value to adjust height-bar for variable terrain heights.
Left/Right arrowkeys rotate a picked up object.




Open MMORPG: It's your game!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Jul 2009 16:28
RiiDii, that just spoiling us, nice and simple, like it, add the ground height thingy and its all done for us.

Dark Physics makes any hot drink go cold.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 14th Jul 2009 19:41
Ok. Ground height thingy added (I think that's what you meant). I also added the ability to Y-Rotate an object that has been picked up using the left/right arrowkeys. The camera movement has been changed to WASD to accommodate the new arrowkey functionality.

Wow. This could easily become a sort of 3D environment editor.


Open MMORPG: It's your game!
Softwizz
14
Years of Service
User Offline
Joined: 14th May 2009
Location: U.K.
Posted: 24th Jul 2009 16:42 Edited at: 24th Jul 2009 16:44
that is awesome, my man, truely awesome indeed
as you say:
Quote: "Wow. This could easily become a sort of 3D environment editor."

I think I will adapt this to load a dbo level so I can place objects in it.
I will need a way of saving the co-ords of each object placed, any ideas on a way to do this?

Nothing to see here, move along please.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 24th Jul 2009 20:57
Thanks Softwizz.

Quote: "I will need a way of saving the co-ords of each object placed, any ideas on a way to do this?"


Basically, an array would do the trick. Then save the array.

However, I am working (from the ground up) on an Object-Oriented style library for DBPro. This will include the ability to save object placement data; more than likely the placement data will be with a parent object.


Open MMORPG: It's your game!
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 28th Jul 2009 12:56
'Move Camera Up 4' doesnt work in DBP 1.06x updates
but 'position camera camera position x(),camera position y()+4,camera position z()' does the very same, I think.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th Jul 2009 17:29
Oops. That is probably an IanM Matrix1Utils command. I use those so much, I sometimes forget which commands are native and which are from his utility.


Open MMORPG: It's your game!

Login to post a reply

Server time is: 2024-05-05 09:30:08
Your offset time is: 2024-05-05 09:30:08