Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Irene

#1
Support / Loading images
August 19, 2011, 12:16:25 PM
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:

Object3D myBox = null;
myBox = Primitives.getBox(21f, 2f);

I loading a texture this way:

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

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!