Need help with getting a position on a model

My current problem is a logical one. I would like to get position and rotation data of a specified area of a mesh. I am currently using jme2.0 and the md5importer. Since the XML exporter/importer does not exist within jme2.0, I do not know how export “empty” object types from Blender and import them. I have tried to search for an answer before posting, but the only revelant post that I can find was this one, which did not seem to be answered: http://www.jmonkeyengine.com/jmeforum/index.php?topic=7975.0 Thank you anyone and everyone who reads this post~!

Does this mean that many people simply hard code positional data?

Umm your first post is kinda 'muddled' and unclear as to what your actual question is.



For positional calculations you will need to 'reverse' the translations and rotations that are applied to a give mesh.  BUT I believe the TriMesh class already has some helper methods that might be just what you need:


TriMesh.localToWorld()
&
TriMesh.worldToLocal();



Hope that helps...

As to specifying a position, I prefer to do this in a separate file. I see it as logically separate data.

For example, when I specify the position of a gun, or thruster that is part of the logical model (needed to do underlying things like apply forces, spawn bullets aswell as for display), whereas the mesh is purely part of the view.



I suppose camera attach points mentioned in the other post are purely view also, but I would still keep them separate. I just think it's clearer to have meshes in files that are just meshes - I don't want to have to do any extra work on them to put them into the game.


Thank you so much both of you Alric and basixs~! Previously, I imagined that 3d models should have some logic since the model would know where something would be emitted. Thanks again~!! I really hope that I can do something magical with this engine.

basixs said:

Umm your first post is kinda 'muddled' and unclear as to what your actual question is.

For positional calculations you will need to 'reverse' the translations and rotations that are applied to a give mesh.  BUT I believe the TriMesh class already has some helper methods that might be just what you need:


TriMesh.localToWorld()
&
TriMesh.worldToLocal();



Hope that helps...


hey basixs in which directory is the TriMesh class in jME 2.0 i'm unable to find the proper package??

package: com.jme.scene.TriMesh :slight_smile:

basixs said:

package: com.jme.scene.TriMesh :)


ahh yes thx basixs