Im working with the jMonkeySDK on a 3D java game at the moment. I really need to know how I can get the mesh from my spatial (3D model). Does anyone have experience with this engine and knows how I can have access to the mesh?
I searched in the documentation and read a lot of tutorials. But I dont find a way. Hope someone can help me
Models inside jME3 are stored as Spatials
, with Spatials
mostly being either a Node
or a Geometry
.
Nodes
just contain other Spatials
(but can transform their position, rotation, etc) while Geometries
just contain Mesh
es and the Material
s and other information associated with the Mesh
.
The easiest way to do this is to open the model in the SDK and use the Scene Explorer window to view the layout of Nodes
and Meshes
. You can then determine what you need to do, as often you need to drill down through a few Nodes
, find the Geometry
you are interested in, and then get the Mesh
from that Geometry
.
Alternatively programmatically you can just recurse down through the Node
structure, iterating over each child. If the child is a Node
then scan that too, if it is a Geometry then get the Mesh
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.