Models loaded into jME3 become much larger than they are in sketchup/blender/3dsmax

i have imported models from a few places (mainly sketchup at the moment) and when i put them in the scene(for example a sword) it takes up the entire heitmap space leaving me like :[__]…i have been scaling them down in sketchup to rediculously small sizes but that takes FOREVER and i have quite a few models… is there anything that might be wrong here or is there at least a scale button for the scene?



p.s. if this topic should be under terrain editor go ahead and move it there

This is a good question that fits in this board. Generally in sketchup the world space is reasonably large, especially if you are working in inches. So 10 feet in sketchup will be 120 inches, or 120 world units in the SDK (pretty large), if it exports in inches that is. I haven’t played around too much with the exporting in sketchup, but there might be options to change the units before or during export.

In the JME SDK you can easily scale down the models in the right hand properties panel; it’s probably quicker than doing it in sketchup (you can just type in the scale you want). Once you have scaled it, save the model as a .j3o and you will have the correct size next time you load it.

@Sploreg said:
This is a good question that fits in this board. Generally in sketchup the world space is reasonably large, especially if you are working in inches. So 10 feet in sketchup will be 120 inches, or 120 world units in the SDK (pretty large), if it exports in inches that is. I haven't played around too much with the exporting in sketchup, but there might be options to change the units before or during export.
In the JME SDK you can easily scale down the models in the right hand properties panel; it's probably quicker than doing it in sketchup (you can just type in the scale you want). Once you have scaled it, save the model as a .j3o and you will have the correct size next time you load it.



thank you so much there is an option to change units and ill try it also i have another quick question. Im not sure if my sword is hi poly or what but when i add it my fps goes from 1850 to 10 (running on an HD Radeon 6790 1GB) and the physics for it are weird and in slow motion....

edit: after scaling it down it fell through the world O.o

100-300 polygons is about the size you want for a sword, how many does it have?

@Sploreg said:
100-300 polygons is about the size you want for a sword, how many does it have?


this is going to sound very unintelligent but, I am a programmer, the only reason im screwing with models is because my modelers are slacking atm and i cant get models from them. I don't know how to get the polygon count off of sketchup...


EDIT: i found out that su calls polys faces and its under model info so under model info it says i have 468 faces so im guessing 468 polys? also says 817 edges and 18 materials

A face might be two triangles, so about 900 polygons. Still not too bad but more than you want for a sword. And it shouldn’t cause that kind of frame rate hit. If you have a bunch of other code in the game, try loading the model in a simple test case and see what performance it gets in there. It could be something else causing problems.

How are you getting the models into jme? I haven’t tried the Sketchup → jme route yet.

@backspace119rd said:
this is going to sound very unintelligent but, I am a programmer, the only reason im screwing with models is because my modelers are slacking atm and i cant get models from them. I don't know how to get the polygon count off of sketchup...


EDIT: i found out that su calls polys faces and its under model info so under model info it says i have 468 faces so im guessing 468 polys? also says 817 edges and 18 materials

Let's make it easier for all of us. How about you send us a screenshot of the model, inside jME3, with the statistics display turned on? Then we will be able to see the actual poly/vertex counts in jME3.
@Momoko_Fan said:
Let's make it easier for all of us. How about you send us a screenshot of the model, inside jME3, with the statistics display turned on? Then we will be able to see the actual poly/vertex counts in jME3.







strangely enough i found that the fps actually only dropped after i walked in the area where the sword fell through the world... the model has 2450 triangles and 4770 vertices (a bit too many id say :) ) and im hoping this is the only reason that physics act up with it and it is lowering fps... (sorry about screenshot i got one but figured id just post the numbers instead it was getting 30 fps
@Sploreg said:
A face might be two triangles, so about 900 polygons. Still not too bad but more than you want for a sword. And it shouldn't cause that kind of frame rate hit. If you have a bunch of other code in the game, try loading the model in a simple test case and see what performance it gets in there. It could be something else causing problems.
How are you getting the models into jme? I haven't tried the Sketchup -> jme route yet.



there is an ogrexml exporter for su which i have been using

If you’re using GImpactCollisionShape for physics it will definitely be slow with that many triangles. You can either use HullCollisionShape or create a collision mesh for your model with much less triangles.

@Momoko_Fan said:
If you're using GImpactCollisionShape for physics it will definitely be slow with that many triangles. You can either use HullCollisionShape or create a collision mesh for your model with much less triangles.



im pretty sure im using a collision mesh: heres what it is

in my initApp

Objects objects = new Objects();

Spatial sword = objects.swords("sword1.j3o", assetManager);

sword.scale(0.4f);
rootNode.attachChild(sword);

bulletAppState.getPhysicsSpace().add(sword);


this is my Objects class

public class Objects {


public Spatial swords(String swordName, AssetManager assetManager)
{
Spatial sword = null;
RigidBodyControl sword_phy;
if(swordName.equals("sword1.j3o"))
{
sword = assetManager.loadModel("Models/swords/" + swordName);

CollisionShape swordShape = CollisionShapeFactory.createMeshShape(sword);
sword_phy = new RigidBodyControl(5f);

sword.addControl(sword_phy);

}



return sword;
}




}

@backspace119rd: Have you read the documentation?

http://hub.jmonkeyengine.org/javadoc/com/jme3/bullet/util/CollisionShapeFactory.html#createMeshShape(com.jme3.scene.Spatial)

@Momoko_Fan: no i had just went through the beginner tutorials and googled a few things and read a little of the intermediate tutorials now this makes a little more sense :stuck_out_tongue: sry about the mix up. ill try it with the dynamic mesh shape

@Momoko_Fan: it still falls through the world and still gives a huge frame hit here is the changed code



sword = assetManager.loadModel(“Models/swords/” + swordName);



CollisionShape swordShape = CollisionShapeFactory.createDynamicMeshShape(sword);

sword_phy = new RigidBodyControl(5f);



sword.addControl(sword_phy);





this is out of the object class

Do NEVER use dynamic mesh shape, except you really know why. Usea cylinder or a streched box, it will be close enough