how to modify uv sequence?

Started by newton, December 26, 2012, 11:07:43 AM

Previous topic - Next topic

newton

hello!  I am now working on a project which needs the water wave  effect.
I wonder how to modify the uvs after I create a object3D with the uv sequence, use the api like this
obj = new Object3D(vertices, uvs, indices, TextureManager.getInstance().getTextureID("texture"));

newton

it seems like i can use polygon manager to solve the problem, but after i used the api "polyManager.setPolygonTexture(p, textInfo);" , nothing happened.

any idea? thanks.

EgonOlsen

By default, jPCT-AE compiles the meshs in a way that future modifications of uv coordinates will be ignored. To change that, you have call build(false) instead of just build() on the object. However, this might not be the best solution, because it's not very efficient.  Have you considered to work with the texture matrix instead? It works like a transformation matrix for uv coordinates and it much more efficient and simpler to use.

newton

I have noticed that. Only 1 fps by using Pologon Manager. I'll try the texture matrix.Thank you.

EgonOlsen

1fps seems to be pretty low even when using that inefficient method. What's the polygon count of your mesh?

newton

33 thousand polygons. Is it strange?
I tried to use Texture Matrix but I don't know how it worked at all.
I searched Texturematrix on this forum and google, nothing helpful things were found.
Can you give me some advice?

EgonOlsen

33.000 is huge for a mobile device...what kind of mesh is that? Anyway, you'll find the method to set the texture matrix in Object3D.

newton

128 * 128 vertices. Every 3 nearest vertices construct a triangle.