Hi! I know this must be a very stupid question since I couldn’t find an answer myself in the forum, but stil… As you can easily guess, I’m a total noob jme-wise so please forgive me!
I tried to get a cylinder in my simpleInitApp function, this way:
[java]
Cylinder cylinder = new Cylinder(10, 10, 1, 1);
Geometry geoCylinder = new Geometry(“Cylinder”, cylinder);
Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
mat.setColor(“Color”, ColorRGBA.White);
geoCylinder.setMaterial(mat);
rootNode.attachChild(geoCylinder);
[/java]
…but nothing happens. No cylinder is rendered. Why?
Thank you for reading my question!
The code looks fine. Not that much different than the basic game code you start with. So the problem is somewhere else.
Make a simple test case illustrating the issue and then when that works you can go back and figure out what’s different about your version that doesn’t work.
It works fine with a Box (same code, just slightly adjusted to fit the Box’s constructor’s requirements). Actually, it is a test case: I was trying to draw a cylinder just for the sake of it, in order to practice with the API - and then add cylinders in another program.
The rest of the code wouldn’t even deserve to be mentioned: class and main function, that’s it. Could you please compile it and let me know if it works for you?