Standard Assets & Camera

Hello there. Im very new to jMonkey engine, this is my 2nd tryout on it. First time i tryed to use it but i was a total noobie in Java. This time i got way more skills and ill give my second shot.



The first thing im curious about is where can i see the default assets ?? Sometimes a tutorial or a item in a pallete calls for a non existing asset.



Second thing is, how can i control the camera ? Even if i write some listeners, they do work , but i still can control the camera with the standard arrow keys for example.



Thanx alot for your help !



[]´s Ziden

ok just found



flyCam = new FlyByCamera(cam);

flyCam.setMoveSpeed(1f);

flyCam.registerWithInput(inputManager);



so i could disable the normal camera view. There is a cam and there is a flyCam ? why ?

flycam is a first person cam. cam isn’t. http://www.hub.jmonkeyengine.org/wiki/doku.php/jme3:faq#how_do_i_switch_between_third-person_and_first-person_view

1 Like

Ok, camera problem solved. Now where can i check de ‘default’ assets ? :X

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:asset_manager

1 Like

thanx for your help



I know how to use assets, but i cant find the standard ones to check em out ! I mean, there are many kind of pre-made lights etc’s and i wanted to test them out.



By the way, would you know how to make a box with more then 1 different texture ?





Thanx alot for your help.

Yes. It’s called UV Texture Mapping. Most of the times it’s done by using a modeling sofware (e.g Blender) where it’s easily done. Then when you import your model into jme, it already comes uv textures. About the assets, are you talking about the test assets like in demos and tutorials? Just add the “test-data” libraly to your project’s classpath, or create a jMETests project in jMP via "new Project


>jMETests" or checkout it from SVN repository http://code.google.com/p/jmonkeyengine/source/browse/#svn%2Ftrunk%2Fengine%2Ftest-data.

Ive created the project, and they work…i want to make 100% procedural drawing i wont use 3d models, it will be a simple game from the begining.





The test project works fine, but how can i know what do exists ? for example, “Common/MatDefs/Light/Reflection.j3md” is a material with a cool effect, how could i know this existed if it wasnt on this example . What i mean is, isnt there a list of the ‘default toolkit’ ?



Thanx for your help !

Oh btw, i cant edit

By procedural modelling im having 2 difficulties:



1-) I can make a texture on a cube. I can make light effects on the cube, but i cant make both of em together.



2-) I cant place different textures on every quad of the cube. Would i need to make a new mesh for that ?



Thanx for the attention sorry for doublepost i couldnt edit.

@Ziden said:
Oh btw, i cant edit
By procedural modelling im having 2 difficulties:

1-) I can make a texture on a cube. I can make light effects on the cube, but i cant make both of em together.


Lighting.j3md can certainly do textures and lighting at the same time. Go through the materials tutorial, I guess.

@Ziden said:
2-) I cant place different textures on every quad of the cube. Would i need to make a new mesh for that ?


With standard Lighting.j3md (and Unshaded.j3md also) you can only have one texture... so you'd have to have one quad per material.

Note: if you are making a Minecraft-clone, the world is not made up of boxes. This will never perform well. Block worlds are made up of batches of quads... just the visible ones.

Yes. You can edit. Just join the group.

About the material stuff, you can “visually” create and test the jme3 materials via jMonkeyPlataform SDK. Just create a empty j3m material via new File


>Empty j3m Material. When it's created, you can edit it visually by opening it in MaterialEditor by right clicking the material file
>open.
You can search for materials in jMETests project too, by right clicking "ctrl+shift+f" in jMP/netbeans or "ctrl+h" in eclipse. There's a searh field right there too
>.
Also, there are nice material references in wiki :
http://www.youtube.com/watch?v=IuEMUFwdheE
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:materials_overview
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:material_definitions
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:j3m_material_files
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_material

I can make a texture on a cube. I can make light effects on the cube, but i cant make both of em together.


Take a look at the lightning material definition.

2-) I cant place different textures on every quad of the cube. Would i need to make a new mesh for that ?


If you really want to do it dinamically / programmatically, take a look at this :

http://hub.jmonkeyengine.org/groups/graphics/forum/topic/different-texture-for-each-face-of-a-cube/

EDIT: OH, pspeed is really fast ;).
@pspeed said:
With standard Lighting.j3md (and Unshaded.j3md also) you can only have one texture… so you’d have to have one quad per material.


Or using uv mapping.

Thanx alot for the help. There is pretty much information there.



But for setting the texture for that material in-code, i only noticed 4 methods :



mat_lit.setTexture(“DiffuseMap”, texture);

mat_lit.setTexture(“NormalMap”,);



This is cool, ill try that later when i contact my 3d mod friend, but not what im looking for.



mat_stl.setTexture(“m_ColorRamp”, texture);



This is the classic ‘color gradient’, but i couldnt use a texture with this.



mat_stl.setTexture(“ColorMap”, texture);



This is good, but only works if im using SImpleTexture, not Lightining, why ? It shows the texture just fine, but no light at all.



Thanx alot for the help !! Im liking jmonkey engine alot :smiley: Getting used to it.



BTW: Not a minecraft-clone, would be something more similar to super smash bros. Characters would be something like rayman lol.

SimpleTexture has no lighting. That’s what Lighting is for.



Also, SimpleTexture implies that you are running an ancient version since that was removed and replaced with Unshaded a long time ago, I think.



DiffuseMap is usually the one that a person would want to use to set the texture. ColorRamp is for something else and ColorMap is ancient.

Hmm so i have to use diffuse map ?



Makes light so rought :X

isnt there an easy way of doing light ? hehe



if SimpleTextured is outdated, pretty much all tutorials are. I followed all of em, ive found easy as hell to ‘make things work’ except lightining, witch im still not sure how it works. I couldnt make a simple light that works on a texture yet.

I don’t understand what’s hard.



Make some geometry.

Set the lighting material.

Give it a texture.

Add a light to your scene.



Which of these steps do you think could be left out and still have it work?

1 Like

The add a light part is not really just add add a light to your scene.



I have to add several lights to make it work. If i add a single direction light or a single light point it wont get right. Isnt there a way to make it a standard light to make things visible, and another light to make the effect ? Im really having trouble on this part making it a ‘normal 3d look’.

Thanx alot for your time !

You could add an ambient light to add ambient light.

1 Like

couldnt find any example or tutorial about ambient light

could you point one please ?



thanx alot for your patience and help !

https://wiki.jmonkeyengine.org/legacy/doku.php/?do=search&id=AmbientLight