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.


Topics - Kaiidyn

Pages: 1 [2]
16
Support / Rotating Object
« on: November 23, 2010, 03:23:53 pm »
When using Object3D.rotateX the object rotates the object with the value given.
Is it possible to do like Object3D.rotateX(Math.toRadians(45)); in the renderloop and keep the object rotated at 45 degrees, instead of adding 45 deg. to the current rotation value?

Edit: Also is it possible to get the current rotate value?

17
Support / Texturing a Primitive
« on: November 21, 2010, 10:06:09 am »
Hello,

I just started out a couple of days ago with 3D programming for Android,
And jPCT-ae really got my attention, It's easy to use and well documented.
But I got a problem putting a texture on a Ellipsoid primitive.

Code: [Select]
TextureManager.getInstance().flush();
TextureManager tm = TextureManager.getInstance();
Resources res = Engine.resources;

/** LOAD TEXTURES **/
Texture random = new Texture(Engine.resources.getDrawable(R.raw.random));
tm.addTexture("random", random);

TextureInfo randomTex = new TextureInfo(tm.getTextureID("random"));

button1 = Primitives.getEllipsoid(64, 0.5f);
button1.setTexture(randomTex);
button1.build();
button1.translate(0, -125, 0);
world.addObject(button1);
All this code is located in onSurfaceCreated.

The texture I'm trying to put on.

I got the feeling it does actually work, but partially,
As I see my entire mesh in red.
I think I need to do something with the UV Mapping, but have no idea how that works.
Or, it has something to do with texture scaling.. that the image is too big for the object.

My question therefor is, how do I downscale the texture to match my object, or how does UV Mapping work?

Kind regards,
Kaiidyn.


Edit:
Figured out that it is actually a problem with the UV mapping,
the center of the texture (where i have the text) gets put on the side of the Ellipsoid that has been squeezed by the scaleHeight.
What I want is that the text in the texture is set on the top of the primitive as a button, like This one.
But I have no idea how to do that.

Pages: 1 [2]