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 .NET / I Have to create an application of 3d editor with camera navigation like in 3D studio MAX. Need Help!

Author
Message
AlecG
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 5th Apr 2011 15:24
Hello! Well I jave some problems with that.

1) How it is possible to move camera using middle mouse button. Camera should not rotate. But it shoudl move ud and down and to the right and to the left when the user is holding middle mouse button and moving the mouse.

2)How it is possible to move camera along Z axis using scrolling wheel.

Can you help me with that?

Dark GDK IS THE BEST!!!!
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 6th Apr 2011 19:16
OK
i might be able to help with some things... you can figure out the rest...

first... If you want the mouse to move using the mouse movement while the middle button is down, then this example will let the mouse move forward if the mouse is moved up, and backward if the mouse is moved down:


thats just to show that it is possible. You can use the DarkGDK.IO.Mouse.MoveY and DarkGDK.IO.Mouse.MoveX to do stuff with the mouse's movement, it has to become a float value first to work with 3d coords.

it would be very easy if the camera had a MoveUp method like objects do, but it doesn't ... so just for an example i have created an object that works with the camera:

Then in the game loop:


Also...
the mouse has a property called DarkGDK.IO.Mouse.MoveZ
it works with the scroll wheel...

This should be enough for you to figure it out
AlecG
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 7th Apr 2011 10:12
Thank you very much!!!! But all this dose not work in windowed mode only in full screen mode. This is serius bug ind i have to write my own class to work with mouse unput and camera navigation.

Dark GDK IS THE BEST!!!!
AlecG
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 7th Apr 2011 18:25
I have another guastion. I need to delect and drag different objects using mouse.

1) Can you help me to 3d point coordinates from my 2d screen coordinates?

2) How can i create a texture from my screen. Then put this texture on the plane in real time?

Dark GDK IS THE BEST!!!!
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 9th Apr 2011 22:07
ehm, well - use the "pick object" from DBPro.
Or you could do it like this;

Background color is 0,0,0
Every time you create a object you give it a color that isnt 0,0,0 and that isnt assign to any other object. Then u render the scene with no fog, shadows, etc(only clipping distance). Read what color is under the mouse. Then use that color to loop for the selected object.

Keep it simple.
Questions? Mail me

Login to post a reply

Server time is: 2024-03-29 05:53:42
Your offset time is: 2024-03-29 05:53:42