3DS Help

Hi,



    I replaced the file in the demo TestMaxJmeWrite.java with a 3DS file in which the simple biped model is animated.

When I run TestMaxJmeWrite.java I can see only the nodes or joints of the biped model in a black background.



Can you please help me in order to fix this problem so that I am able to view the exact bipe as it plays in Max.



Thank you



Pranav Bhalla

Could you elaborate more on this problem? Perhaps post a couple of screen-shots illustrating the problem?

Try using SceneGraphDump on it and post the output here.

I went through SceneGraphDump but couldn’t understand how to use it.



Here are the screenshots…



This is the actual biped walking…







And when the same 3DS file is run through the TestMaxJmeWrite.java, this is what happens







Some nodes are clearly seen here in white and big white diamond like node would be the pelvis, but I don’t understand why I am not getting the same figure here.

What you see in 3ds max is not actual scene geometry, but a visualization of a control structure (skeleton) which you can use to deform geometry. I am surprised that 3ds exported any geometry at all - did you check some "export bone geometry" option somewhere in 3ds? Then that caused the exporter to add the white diamonds you see. If there are no other relevant options where you found that, I'd guess there is no way to export the skeleton visualization just as it is shown in 3ds max.



HTH

Ok. But the example TestMaxJmeWrite.java shows an exported 3DS model. Does it mean that only selected things from 3DS can be exported to JME ? Also, how can I export a 3D character model to JME, apart from 3DS which is now ruled out, so that I enable my users to control each part of that character through a Swing UI ?


pranavbhalla said:

Does it mean that only selected things from 3DS can be exported to JME ?

Of course! 3ds has tons of control structures and other stuff you wouldn't even want to be exported. Think of the grid that is shown in
the 3d views in 3ds, you'd be very surprised if that would show up in jME after exporting/importing your scene. The same goes for the biped: it is only there to deform other meshes. You don't even have a character model in 3ds yet - you only have a skeleton which you can use to deform a model you have yet to create.

It looks like you are trying to do some "quick" 3d modeling on the side for your coding project - I'm afraid that won't work. 3d modeling is a very complex task, with character modeling probably being the supreme discipline.
You'll need at least a rudimentary understanding of how character animation works to get started - and that is by far more information than what can be reasonably provided in this forum.

Try reading your 3ds/character studio manual, from what I remember of looking into one some years ago it contains some very good information about character modeling. After you have an understanding of the difference between control structures and actual scene geometry, you'll be able to ask questions that can be answered in less than 10k lines :)

Erm… looking at the screenshot again, there's clearly geometry there, bones in 3dsmax look completely different.

It says on the wiki page on how to use SceneGraphDump:

Usage is very simple, just call SceneGraphDump.dump on your scene and all information will be printed to standard output. You can also optionally call showLetterKeys for descriptions of the letter keys used in the output for RenderStates and Geometry Buffers.
Momoko_Fan said:

Erm.. looking at the screenshot again, there's clearly geometry there, bones in 3dsmax look completely different.

The screenshot shows a "biped" skeleton, which is in many ways different than the conventional "bones" structures in 3dsmax. But AFAIK it does not contain any scene geometry. It certainly might be different nowadays, but this is what Character Studio's "biped" skeleton looked like years ago, and I know for sure that it wasn't meant to be production rendered nor exported as geometry back then, but as a controller to deform a mesh skin.

It is mentioned that I should call SceneGraphDump.dump on my model or rootnode. I don't quite get how to call it. It is obviously a class but could you please specify the precise code i.e. how exactly to use it with say TestMaxJmeWrite.java file given in the demos. It might be an elementary issue for you, but I am a newbie here.



And as mentioned by havee, I should carefully go through character modelling manuals. Actually, I have gone through those provided by Autodesk online. They simply show how to create character models in max. I want to understand how games incorporate such characters and let their users control them. Is it that I'll have to script a new exclusive loader in JME myself for loading my character model in my game ?


You need to call it on a spatial object, all SimpleGame derived classes have the root called "rootNode" so you can call on that.

Example:


SceneGraphDump.dump(rootNode);

Got it… Applied SceneGraphDump on the exported biped model in 3DS…and this is what I got…



Node: rootNode

RenderStates: LWZ

Transform: (0.0, 0.0, 0.0)[-89.99999, 0.0, 0.0]{1.0}

Children: Node/TDS Scene 


Node: TDS Scene
Transform: (10.0, 0.0, 0.0)[0.0, 0.0, 0.0]{0.1}
Controllers: [com.jme.animation.SpatialTransformer@1529976]
Children: Node/Bip01 
Node: Bip01
Children: TriMesh/Bip01-1  Node/Bip01 Pelv  Node/Bip01 Foot 
TriMesh: Bip01-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 6
Triangles: 8
Node: Bip01 Pelv
Children: TriMesh/Bip01 Pelv-1  Node/Bip01 Spin 
TriMesh: Bip01 Pelv-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 27
Triangles: 50
Node: Bip01 Spin
Children: TriMesh/Bip01 Spin-1  Node/Bip01 Spi0  Node/Bip01 L Th  Node/Bip01 R Th 
TriMesh: Bip01 Spin-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 65
Triangles: 126
Node: Bip01 Spi0
Children: TriMesh/Bip01 Spi0-1  Node/Bip01 Spi1 
TriMesh: Bip01 Spi0-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 65
Triangles: 126
Node: Bip01 Spi1
Children: TriMesh/Bip01 Spi1-1  Node/Bip01 Spi2 
TriMesh: Bip01 Spi1-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 65
Triangles: 126
Node: Bip01 Spi2
Children: TriMesh/Bip01 Spi2-1  Node/Bip01 Neck 
TriMesh: Bip01 Spi2-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 65
Triangles: 126
Node: Bip01 Neck
Children: TriMesh/Bip01 Neck-1  Node/Bip01 R Cl  Node/Bip01 Head  Node/Bip01 L Cl 
TriMesh: Bip01 Neck-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 31
Triangles: 58
Node: Bip01 R Cl
Children: TriMesh/Bip01 R Cl-1  Node/Bip01 R Up 
TriMesh: Bip01 R Cl-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 18
Triangles: 32
Node: Bip01 R Up
Children: TriMesh/Bip01 R Up-1  Node/Bip01 R Fo 
TriMesh: Bip01 R Up-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 41
Triangles: 78
Node: Bip01 R Fo
Children: TriMesh/Bip01 R Fo-1  Node/Bip01 R Ha 
TriMesh: Bip01 R Fo-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 45
Triangles: 86
Node: Bip01 R Ha
Children: TriMesh/Bip01 R Ha-1  Node/Bip01 R Fi 
TriMesh: Bip01 R Ha-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 28
Triangles: 52
Node: Bip01 R Fi
Children: TriMesh/Bip01 R Fi-1  Node/Bip01 R F0 
TriMesh: Bip01 R Fi-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 45
Triangles: 86
Node: Bip01 R F0
Node: Bip01 Head
Children: TriMesh/Bip01 Head-1  Node/Bip01 Hea0 
TriMesh: Bip01 Head-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 87
Triangles: 170
Node: Bip01 Hea0
Node: Bip01 L Cl
Children: TriMesh/Bip01 L Cl-1  Node/Bip01 L Up 
TriMesh: Bip01 L Cl-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 18
Triangles: 32
Node: Bip01 L Up
Children: TriMesh/Bip01 L Up-1  Node/Bip01 L Fo 
TriMesh: Bip01 L Up-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 41
Triangles: 78
Node: Bip01 L Fo
Children: TriMesh/Bip01 L Fo-1  Node/Bip01 L Ha 
TriMesh: Bip01 L Fo-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 45
Triangles: 86
Node: Bip01 L Ha
Children: TriMesh/Bip01 L Ha-1  Node/Bip01 L Fi 
TriMesh: Bip01 L Ha-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 28
Triangles: 52
Node: Bip01 L Fi
Children: TriMesh/Bip01 L Fi-1  Node/Bip01 L F0 
TriMesh: Bip01 L Fi-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 45
Triangles: 86
Node: Bip01 L F0
Node: Bip01 L Th
Children: TriMesh/Bip01 L Th-1  Node/Bip01 L Ca 
TriMesh: Bip01 L Th-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 53
Triangles: 108
Node: Bip01 L Ca
Children: TriMesh/Bip01 L Ca-1  Node/Bip01 L F1 
TriMesh: Bip01 L Ca-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 51
Triangles: 98
Node: Bip01 L F1
Children: TriMesh/Bip01 L F1-1  Node/Bip01 L To 
TriMesh: Bip01 L F1-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 54
Triangles: 104
Node: Bip01 L To
Children: TriMesh/Bip01 L To-1  Node/Bip01 L T0 
TriMesh: Bip01 L To-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 16
Triangles: 28
Node: Bip01 L T0
Children: TriMesh/Bip01 L T0-1  Node/Bip01 L T1 
TriMesh: Bip01 L T0-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 16
Triangles: 28
Node: Bip01 L T1
Children: TriMesh/Bip01 L T1-1  Node/Bip01 L T2 
TriMesh: Bip01 L T1-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 16
Triangles: 28
Node: Bip01 L T2
Node: Bip01 R Th
Children: TriMesh/Bip01 R Th-1  Node/Bip01 R Ca 
TriMesh: Bip01 R Th-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 53
Triangles: 108
Node: Bip01 R Ca
Children: TriMesh/Bip01 R Ca-1  Node/Bip01 R F1 
TriMesh: Bip01 R Ca-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 51
Triangles: 98
Node: Bip01 R F1
Children: TriMesh/Bip01 R F1-1  Node/Bip01 R To 
TriMesh: Bip01 R F1-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 54
Triangles: 104
Node: Bip01 R To
Children: TriMesh/Bip01 R To-1  Node/Bip01 R T0 
TriMesh: Bip01 R To-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 16
Triangles: 28
Node: Bip01 R T0
Children: TriMesh/Bip01 R T0-1  Node/Bip01 R T1 
TriMesh: Bip01 R T0-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 16
Triangles: 28
Node: Bip01 R T1
Children: TriMesh/Bip01 R T1-1  Node/Bip01 R T2 
TriMesh: Bip01 R T1-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 16
Triangles: 28
Node: Bip01 R T2
Node: Bip01 Foot
Children: TriMesh/Bip01 Foot-1 
TriMesh: Bip01 Foot-1
.......................
TriangleBatch: null
Batches set: VIT0
Vertex: 9
Triangles: 8




What information can we get out of this ?

OK, so the geometry is definitely there. Sorry for the misinformation! The Nodes seem to be in the correct positions too - maybe the geometry is just scaled incorrectly. Perhaps you can work around that by a recursive walk down the children of Node "Bip01", and scale them up by some factor if they are instanceof TriMesh.

Not sure if it matters but it seems like the meshes are missing normal data while lighting is used. Try pressing L in the window and see if anything changes. Also the model is scaled down to 0.1, you might want to scale it up a bit.

By pressing L in the scene only the nodes get brighter. Nothing other than this takes place.

Is there any way by which I could make the mesh also visible ?

And how exactly can I change the scaling ?

To change the scaling you would have to call setScale (or something like that) on the node that would contain your mesh. Also, maybe the bounds would help (toggle with the 'B' key), but you might have to create bounds for the top most node of your mesh, and then call updateModelBounds in it.

OK great, I'll try that and will get back to you when I have tried doing that. So that means with some editions I could actually see the biped model in JME as it was seen in MAX with the same texture and all ?

Are you sure the model displayed in 3DS is not a NURB or subsurf mesh?



Is there any way by which I could make the mesh also visible ?

The 'T' key changes the display to wireframe.

I created the biped by simply clicking the biped button and dragging it. then i just animated it. I didnt see ne NURB

or subsurf mesh anywhere…

how can I get the same texture back in the scene as it was in MAX ?

Doing a quick google search it looks as if a biped IS really a skeleton and a control mesh.



If thats the case then the control mesh (skin) needs to be a true polygon.  The reason being is that I don't think jME supports control meshes (including subsurfs or nurbs).  As far as how you get there; I don't know, I use blender. :expressionless: