I know how to get x,y value from mouse pointer so using these value i can move a 2D Object. But in my project i want to move a 3D Object based on the dragging speed. I dont know how to do please help me with an example.
awaiting for your reply.....
mouse pointer(7 posts) (3 voices)
This topic may help you : http://www.3dvia.com/forums/topic/need-help#post-67127
Hi hiddentux thanks for your reply. I am not expecting this drag and drop concept In the physics world 3D Object has to move as for the mouse speed movement...
For more clarification, please have a look at the image. You can understand my need.
I created a quick sample... you obviously need to more graphical cues / restrictions in place for the full angry birds effect but in the sample click and drag to the left... the farther you drag to the left, the further the ball will fly forward. I commented the code inside, let me know if this helps.
Hi iainB...thanks for the sample...helped me in my project...
have you done something for angle?...
in the sample... it goes based on the speed of mouse-click-drag..
along with this, can we do it according to the angle as i drag using mouse?
Angles / orientation can be tricky a 3D enviornment. You certainly could use this to affect the tradjectory of the ball, but a simpler solution might simply be to use the Y coordinates of the mouse (how high or low is the mouse on screen in relation to ball) then come up with a calculation to use that as Y velocity on the ball.
Would that fit your needs?
yeah iainB...i got some idea. Let me try with the coordinates as you said.
You must log in to post.