PDA

View Full Version : mapping 2d touches into 3d space



Spaceaholic
06-28-2011, 10:01 AM
So I have a world that consists of a floor plane and a bunch of smaller planes that lie perpendicular to it, I need to determine if the user has touched the screen space of the floor or of a building and if a building which building(buildings are smaller perpendicular planes)..

the screen coordinates are mapped out x increasing from 0 to + left to right and y 0 to + top to bottom

How would I go about implementing this in java?
Thanks,
~Spaceaholic

Aria Llianen
06-28-2011, 04:00 PM
I guess that would be 'Picking'. Search for OpenGL picking in google or read chapter 12 of the OpenGL Red Book.
Here's a link: http://fly.cc.fer.hr/~unreal/theredbook/chapter12.html
This teaches all you should know. You can also search for examples using this criteria.