I am just getting started with jME, so any help would be greatly appreciated! So far I made a outdoor flight simulator with chase camera, a few models, and a ton a cubes for a ‘ground’ - that is the extent of my current knowledge.
I would like to be able to create indoor type environments - see screenshot. I have been unable to find anything about quite how to tackle this. Thoughts? Ideas?
I’ll start looking into blender. I was thinking that there had to be a primitive for just a flat plane of non-square size - I don’t know. Looking into blender.
I must disagree here normen, it makes perfect sense composing 3D level from primitives. Especially for someone who doesn’t know or want to play with modelling.
Yeah, the “supported formats” for jME2 were greatly exaggerated, few of the importers actually worked, thats why we continue support only for those importers we know can and will work.
Is there a tutorial on getting the camera ‘in’ the imported object? Mine simply won’t render it if I’m ‘inside’ the object. Also not sure how to get the collision going either. I’m willing to put forth the time & effort - just need a couple of links to guides, please.
Basically you can use google sketchup then export as dae, and import in blender where you export it as ogre xml. Since you don’t need animations or similar for a static level that should work acceptable.
InShadow said:
I must disagree here normen, it makes perfect sense composing 3D level from primitives. Especially for someone who doesn't know or want to play with modelling. :D
Look for example Grappling Hook. :)
No it doesn't, you waste way too many vertices that will never be seen this way. This raises the fill rate and lowers the fps. Even if Grappling Hook or Mythruna might look they are made out of boxes they actually are made of larger mesh parts. Extruding a box a few times in blender to get a simple mesh that looks like BoxWorld isn't hard..
normen is right, definitely go through all of the tutorials, they really make a big difference in understanding jme3. at least they made a big impact on me, i refer back to them constantly.
furthermore, something i noticed…
fuginator said:
protected Spatial ThisLevel;
Material walls = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
walls.setTexture(“ColorMap”, assetManager.loadTexture(“/textures/t_walls.jpg”));
// walls.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off); // didn’t help
ThisLevel = assetManager.loadModel(“Models/TestLvl.obj”);
ThisLevel.setMaterial(mat_blue);
ThisLevel.scale(.005f, .005f, .005f);
ThisLevel.move(0, 0, 0);
rootNode.attachChild(ThisLevel);
im guessing you made the Material walls to use with your level, so it looks like you want change
ThisLevel.setMaterial(mat_blue);
to
ThisLevel.setMaterial(walls);
unless you have a material named mat_blue that is not shown(maybe included with your obj file?).
The |java| buttons above the reply box is to highlight java code. Please use it. Much easier to read.
Also @fuginator try as much as possible to use proper syntax related to java in your program. ThisLevel should be thisLevel. Only Class names should start with a Capital letter. It may sound stupid but we don’t always read each field initializing line and seeing ThisLevel.setMaterial(mat_blue) could also be a static method in class ThisLevel.
In short, you should use:
[java]
protected Spatial thisLevel;
[/java]
Again, I know. It’s small things, but it makes our lives easier when we’re trying to help you out. Everyone does it this way. It’s just good coding habits.