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 / 2d coordinates to 3d coordinates

Author
Message
iammfa
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 16th Nov 2009 11:16 Edited at: 16th Nov 2009 12:07
Hi,
I think, converting 2d mouse coordinates to 3d coordinates important task to make 3d model look always to mouse cursor, i'm using:
float dbsin
to calculate the angle which mouse cursor make with 3d model position
but the 3d model still not rotate,
i attached my source code to know where is my bug..!
this code will found in player.cpp

Attachments

Login to view attachments
HelioSeven
14
Years of Service
User Offline
Joined: 16th Nov 2009
Location:
Posted: 17th Nov 2009 13:19
I don't know if you have your rotation algorithms written correctly, and I'm not about to check, but right off the bat I can tell you that the main reason that nothing is happening in your program is because nothing is happening inside the LoopGDK.

All actions that are not related to setup, deconstruction, or all other non-real-time actions must be inside the while(LoopGDK){ } loop. Currently the only thing you have in there is dbSync(), which just updates the screen.

I would suggest putting a function in the while(LoopGDK){ } loop named rotateObject() or something, and then inside that function have the code that rotates the object using the mouse.

Login to post a reply

Server time is: 2024-10-01 18:33:14
Your offset time is: 2024-10-01 18:33:14