Help with Texture Offset

Started by tyronetudehope, February 24, 2011, 11:20:00 AM

Previous topic - Next topic

tyronetudehope

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

EgonOlsen

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.

tyronetudehope

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

EgonOlsen

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.