Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
www.jpct.net
»
jPCT - a 3d engine for Java
»
Support
»
Move object to mouse click
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Move object to mouse click (Read 1774 times)
qwaqwe
byte
Posts: 1
Move object to mouse click
«
on:
May 09, 2016, 03:57:13 pm »
hi
I have a "world" and an object on it (2D). I want to click anywhere on the world and object should move to the place of click. How can i do this?
Logged
EgonOlsen
Administrator
quad
Posts: 12291
Re: Move object to mouse click
«
Reply #1 on:
May 09, 2016, 07:48:17 pm »
It depends. If your click happens on real geometry, you can evaluate the collision of the picking way with that geometry. If's there's no actual geometry where you are clicking, you can introduce a hidden plane that acts as a picking plane and is visible only in the picking calculation stage.
The code snippets section in the wiki contains a simple mouse follow demo that shows the basic idea:
http://www.jpct.net/wiki/index.php?title=Main_Page#Code_snippets_and_other_tips
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
www.jpct.net
»
jPCT - a 3d engine for Java
»
Support
»
Move object to mouse click