Cubes are not displaying correctly and balls dont keep bouncing

No , the colors dont change, in the debug you will se this pink wireframe on the physics objects, note that they are diferent then spatial objects.
When you turn the debug on, you should see the walls in an pink wireframe, the same way the balls are. Since they didnt show, they are not in the physic world, you need to ckeck it why.

OK Im looking into this now…

so i tried to change some of the material. i get this error message:

Erroneous sym type: com.jme3.texture.Texture.setWrap

here is the code:

matFloor = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    TextureKey key3=new TextureKey("Textures/Terrain/Pond/Pond.jpg");
    key3.setGenerateMips(true);
    com.jme3.texture.Texture tex3 = assetManager.loadTexture(key3);
    tex3.setWrap(WrapMode.Repeat);
    matFloor.setTexture("ColorMap",tex3);

Why did you tried to change the material ?
You know the material has nothing to do with physics right ? Its just for display…

I think you need to set the texture scale coordinates.

yourModelMesh.scaleTextureCoordinates(new Vector2f(2, 2);

In case you don’t know, this will make the object’s texture to repeat 4 times for each face (2x2).

1 Like

I originally thought if I changed the material to something solid that the balls would bounce. Found out that was wrong. I use RigidBodyControl for that.

Try doing the tutorials, you will get a nice base on the game engine there :

http://wiki.jmonkeyengine.org/doku.php/jme3#tutorials_for_beginners

What… the… Sorry, but that doesn’t even make any sense. Engines are not like real life.

The material, as many have said, it’s only for showing the object. Pyhiscs don’t interfere with materials. I really suggest you to do the tutorials

By the way, to make a ball bouncy, you just set it’s restitution

ballPhy.setRestitution(5);

However, keep in mind that setting the restitution is CPU-intensive. Be careful using bounciness.

I am going through the material which is why I am posting stuff. Where do you think I am getting all the jmonkey language from?

As far as the setRestitution, I saw that as far as bouncing too, but I also thought using RigidBodyControl could be used for dynamic objects such as a ball. It used an example of a bouncing ball and the code I have, not the one above, bounces off the wall.

As far as the material, I saw on one of the tutorials, it used a brick wall and everytime the ball hit the wall it broke so I originally assumed if you use different material, you can get different results depending on what you tell it to do…

Also, just because you go through the tutorials doesn’t mean you are just gonna know everything and not have any questions, or make any mistakes. I have to interpret what someone else means and that leaves for multiple perspectives which is why I am posting to this forum so that it is clear and I understand it the correct way…

But thank you for taking the time to explain…

RigidBodyControl is for both static and dynamic objetcs. I use RigidBodyControl to create balls.

I know, you don’t get everything and understand everything by just doing the tutorials. Nobody does. Even the “pros” sometimes have problems that they cannot solve. So, don’t feel discouraged because the people treat you as a newbie :wink: