How to load my own .jpg?

I’m using jMonkey with eclipse. I try to load my own jpg but it doesn’t work :confused: I also don’t know where this textures comes from!?
[java]Texture dirt = assetManager.loadTexture(“Textures/Terrain/splat/dirt.jpg”); [/java]

Can someone please tell me how i can create a terrain with my own pictures? I don’t need any highmap.
I tried to make my own assets-folder but eclipse allways tells me it cant find my pic. :frowning:

Thanks! :slight_smile:

Read the “Hello Assets” tutorial, linked on the right…
and so forth

I tried all this but I think I make a mistake :S
I addet it as a classpath parallel to src.

I have no idea whats my mistake …

I would advise you to try the jme sdk (netbeans).
Even if you’re a die hard eclipse user, just to get accointed with the tools it offers, that you will very probably need down the road.

Just select eclipse shortcuts in the options so you don’t need to learn new ones.
While netbeans does kinda fail compared to eclipse for:

  • alt+cursor completely blows in netbeans… it’s borderline criminally bad
  • no ctrl+e (to search the opened files only) :\

But, it’s also less heavier on the computer and is easier due to being sleeker.
But mostly, it comes with plenty very useful tools for 3D game programming and is ready out of the box. Assets are displayed in the project tree, for example.
Even if you switch back to eclipse at some point, you will still need the sdk for some stuff anyway.

I come from eclipse, but since I selected the eclipse shortcuts, I’ve been a happy monkey, and while I did make the thingy work on eclipse, I stopped using it for game programming because the jme sdk is very nice.

Ok now I switched to to SDK but my terrain is invisible. I can see my skybox but nothing more. Any idea why?

[java]Spatial parkplatz = assetManager.loadModel(“Scenes/newScene.j3o”);

        /** A white ambient light source. */ 
    AmbientLight ambient = new AmbientLight();

thats what i have.

Did you add a directional light or any other type of non-ambient light to your scene?

Lit objects do not get rendered without a light.

Now I added a point light and saw just a black screen. After removing it I saw again a black screen… (Ambient light is stell there)

I updated jMonkey but I can’t see anything in my window. It makes me crazy!

I downloaded the SDK and tried to make my programm visible. But all see in the jMonkey window is a black screen with the fps counter. I updated every thing. When I try to run the programm with eclipse its no problem…


Well, I suspect no one will be able to help you figure out the problem with your code without seeing your code.

I’ve tried that with my auto mechanic before, too… for some reason he doesn’t want to fix my car over the phone. :-/

Hi sppeed, I posted my code before but I will do it again.
But I tried the HelloJME3 code from jMonkey (with the blue box) but I can’t see this, too!


package mygame;

import com.jme3.light.AmbientLight;
import com.jme3.light.PointLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;


  • test

  • @author normenhansen
    public class Main extends SimpleApplication {

    public static void main(String[] args) {
    Main app = new Main();

    public void simpleInitApp() {

     Spatial parkplatz = assetManager.loadModel("Scene/newScene.j3o");
         /** A white ambient light source. */ 
     AmbientLight ambient = new AmbientLight();
         /** A white, spot light source. */ 
     PointLight lamp = new PointLight();


    public void simpleUpdate(float tpf) {
    //TODO: add update code

    public void simpleRender(RenderManager rm) {
    //TODO: add render code

Did you install the latest graphics driver from the graphics card manufacturer (not windows update)? Did you try a directional light? The point light is at 0/0/0, if your model sits there too it won’t be lit by that light. Very strange you don’t see the blue box of a default project though.

@weave said: Hi sppeed, I posted my code before but I will do it again.

I only saw little snippets of the code before… which is 1 billion times different than all of the code.

a) your point light has 0 radius so it won’t light anything.

b) why not just use a DirectionalLight since it’s easier and will be more likely to work the first time?

Edit: actually I guess I’m wrong about the radius… 0 means no attenuation. Anyway, use a directional light to see if that works better. Then you can debug why point light isn’t working.