Hello ppl,
I am new here… i saw many useful things in this forum (thank you), but i have some problems with loading 3d models and i could not find posts about them :-\
I’m trying to make some simple “game”, at the moment i have Oto model loaded + some keys to animate the walking and dodging animation + simple terrain to move on it
(Using JME3, Oto model and the tutorials i found about JME3)
I have problems with finding that Oto model (win 7) i searched everywhere for it and couldn’t find it - Can someone point where he is ?
If i can see how the things work with that model i can make my own models work too (copycat ^^ )
??? The real problem for me is how to load my own models. I am talking about file formats and how to make it work.
for example I can make models on Maya. What format should i export from Maya? Do i need to work on it with some other software so that i can import them in Java and actually move them there?
Ask if you cant catch my thoughts.
Here is samples from my game source for basic scene. I don’t wanna paste whole code here because it will be too confusing + feel free to use it if u want. It is made for education purposes.
{import's from jme3}
public class aHelloSteffMakeUp extends SimpleApplication implements AnimEventListener {
public static void main(String[] args){
aHelloSteffMakeUp app = new aHelloSteffMakeUp();
app.start(); // start the game
}
Node golem;
/** golem's coordinates*/
float xGolem;
float yGolem;
float zGolem;
float scaleGolem;
{
/* golem's starting place*/
scaleGolem = 0.2f;
xGolem = -40;
yGolem = 1;
zGolem = 0;
}
static{
/** Initialize the floor geometry */
floor = new Box(Vector3f.ZERO, 50f, 0.1f, 50f);// shiro4ina viso4ina dyljina
floor.scaleTextureCoordinates(new Vector2f(50, 50));
}
public void simpleInitApp() {
/** Set up Physics Game */
bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);
/** Configure cam to look at scene */
cam.setLocation(new Vector3f(-50f, 5f, 0f));
cam.lookAt(new Vector3f(0, 0, 0), Vector3f.UNIT_Y);
initMaterials();
initFloor();
shootables = new Node("Shootables"); //not needed
rootNode.attachChild(shootables); //not needed
shootables.attachChild(makeCube("a tin can", xGolem, yGolem+3, zGolem)); //not needed
shootables.attachChild(initFloor()); //not needed
/** za animacii ***************************************************************************/
initKeys(); //not needed
initSun();
initGolem();
initCrossHairs(); //not needed
initMark(); // a red sphere to mark the hit //not needed
viewPort.setBackgroundColor(ColorRGBA.randomColor());
};
/** Initialize the materials used in this scene. *****************************************/
public void initMaterials() {
floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
TextureKey key3 = new TextureKey("Textures/Terrain/splat/grass.jpg");
key3.setGenerateMips(true);
Texture grass = assetManager.loadTexture(key3);
grass.setWrap(WrapMode.Repeat);
floor_mat.setTexture("ColorMap", grass);
};
/** MAKE THE GOLEM */
public void initGolem(){
golem = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");
golem.setLocalScale(scaleGolem);
golem.move(xGolem,yGolem,zGolem);
golem.lookAt(new Vector3f(0f,0f,0f), new Vector3f(0f,0f,0f));
rootNode.attachChild(golem);
/** Make golem physical with a mass > 0.0f. */
golem_phy = new RigidBodyControl(2f);
/** Add physical golem to physics space. */
golem.addControl(golem_phy);
bulletAppState.getPhysicsSpace().add(golem_phy);
control = golem.getControl(AnimControl.class);
control.addListener(this);
channel = control.createChannel();
channel.setAnim("stand");
};
/** ADD SUN so we can see the golem*/
public void initSun(){
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -1f, -1).normalizeLocal());
rootNode.addLight(dl);
};
}
If u cant understand something or need more feedback with the things pls ask
Any information given will be great
Thank you in advance!