Selecting a Triangle out of a Sphere

Hi Forum,



(as you might see) I'm new to jMonkey, and here's my first question:



Is it possible to select a Triangle (using the mouse) out of a sphere, and color it maybe red?

If it's not to complicated, i'd be happy to get a short explanation howto :slight_smile:



My idea is to create a Sphere with just a few triangles and painting them by clicking.



I've seen, a Sphere has the method getTriangles having a Index as a parameter, it would be also great knowing howto paint maybe the triange at the Index 0 etc. if that's easier, but i don't know… :cry:



Thanks for answering, Frantic

Thanks alot



for everyone who has the same problem: http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/jmetest/intersection/TestTrianglePick.java



Take a look at this code, change maggie to a sphere, and here you are (you'll have to change the path to your cursor file btw :D)



Its working fine



More problems will be coming soon :smiley:

What you are searching for is mouse picking.

There are some test classes about this topic which are very helpfull. Just try them out.



You can get the picked Triangle directly by using a TrianglePickResult.

Way to clarify your lesson learned for other newcomers mate :slight_smile: