Newbie Question on level design, how to make walls, etc

Hey guys,



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?







Thank you,



Andrew

Just create them using e.g. blender and then import the model, apply a collision shape and fly :slight_smile:

Normen,



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.



Thakns, Andrew

It makes no sense composing a 3d level of primitives really

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. :smiley:

Look for example Grappling Hook. :slight_smile:

I’m okay in Google’s Skechup program - and I see that it will export to dae - and also see jME (should) support dae files - now working on that.

No it doesn’t, OgreXML and obj are your only supported options.

Dang. This lead me to believe otherwise.



https://wiki.jmonkeyengine.org/legacy/doku.php/jme2:zathrasbeginnersfaq?s[]=dae#how_do_i_create_my_game_world_3-d_models

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.

Norman,



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.



Thanks, Andrew

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3#tutorials_for_beginners

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.

Yes, I am crating the level in Skechup, then using MeshLab to convert to an obj file - that works. (finally)



Norman - I will look though those again.



Thanks, Andrew

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,

I’m tyring to use the obj file in this way:


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);

Anything you see wrong here? With just the normal 'flycam' It clips when I try to go into the model.
Thanks again, Andrew.

*Edit - are there
Code:
tags for the forum?

Nothing wrong with the code or the behavior you describe.

I really shouldn’t do this as you should do all tutorials before too but this tutorial (number 9!!) explains how you make stuff “solid”.



Edit: http://hub.jmonkeyengine.org/introduction/website-manual/

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?).

A couple of things guys.



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.

I Blame Dot Net For That Nasty Habit. It’s Really Tough To Read For Any Length Of Time. :slight_smile:

pspeed said:
I Blame Dot Net For That Nasty Habit. It's Really Tough To Read For Any Length Of Time. :)


I blame lazy programmers. ;)