Hi!
My question is probably trivial, but I can't find a solution because I am very new in jpct and 3D at all.
I have an image file 256x256 jpg and I want to load it as texture on primitive created like that:
I loading a texture this way:
But when I have done so I can not see my image on box. In the same time when I loading the same way "rocks.jpg" image from samples, my box became green and texture works.
What am I doing wrong?
Please somebody tell me, how can I place my pic or text for example on primitive or a model?
Also I have the second trivial question:
How can I know the angle between camera and world's Y coordinate axis in degrees? I had tried different ways , like that for example
but I completely messed up with results and was unable to detect camera direction relatively to world's Y-axis. Could you help me, please?
Thank you!
My question is probably trivial, but I can't find a solution because I am very new in jpct and 3D at all.
I have an image file 256x256 jpg and I want to load it as texture on primitive created like that:
Code Select
Object3D myBox = null;
myBox = Primitives.getBox(21f, 2f);
I loading a texture this way:
Code Select
TextureManager tm = TextureManager.getInstance();
Texture test = new Texture(Main.getTexture("/resources/test.jpg")); // getTexture code works well with another image
tm.addTexture("test", test);
myBox.setTexture("test");
myBox.build();
But when I have done so I can not see my image on box. In the same time when I loading the same way "rocks.jpg" image from samples, my box became green and texture works.
What am I doing wrong?
Please somebody tell me, how can I place my pic or text for example on primitive or a model?
Also I have the second trivial question:
How can I know the angle between camera and world's Y coordinate axis in degrees? I had tried different ways , like that for example
Code Select
world.getCamera().getDirection().x
but I completely messed up with results and was unable to detect camera direction relatively to world's Y-axis. Could you help me, please?
Thank you!