www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: tyronetudehope on February 24, 2011, 11:20:00 am

Title: Help with Texture Offset
Post by: tyronetudehope on February 24, 2011, 11:20:00 am
Hi,

I'm trying to get a Min3D example running using jPCT, however, I cannot figure out how to go about modifying the textures offset.

The example I'm referring to is ExampleTextureOffset.java found in Min3D's google code repo.

Is this possible? I thought maybe I need to use the ITextureEffect interface, however, I cannot quite figure out how it works, and am not sure of the U/V values either.

Any help will be greatly appreciated.

Thanks,
Tyrone
Title: Re: Help with Texture Offset
Post by: EgonOlsen on February 24, 2011, 12:11:22 pm
ITextureEffect isn't the right way of implementing this. You can use an implementation of an IVertexController for this. That's the slower but more compatible solution. Or use Object3D.setTextureMatrix(<Matrix>) to apply any possible transformation to the texture of an object. That's the faster solution, but it has problems on some older phones like mine with poorly implemented drivers. I expect it to work on newer phones though.
Title: Re: Help with Texture Offset
Post by: tyronetudehope on February 24, 2011, 02:06:01 pm
Ah ok thanks, I figured ITextureEffect was the wrong way to go  :)

I've successfully transformed the texture, however, am now trying to figure out something else. I can't work out how to apply two different textures of different sizes. I'm using the earth and clouds.png textures from the min3d samples :o

Earth is 512^2 and clouds are 256^2
Title: Re: Help with Texture Offset
Post by: EgonOlsen on February 24, 2011, 02:21:00 pm
Size doesn't matter here. You can assign multiple textures using the TextureInfo-class regardless of their physical size, because everything is normalized anyway. Just make sure that the texture that you want to transform is on stage 0.