www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: newton on December 26, 2012, 11:07:43 am

Title: how to modify uv sequence?
Post by: newton on December 26, 2012, 11:07:43 am
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"));
Title: Re: how to modify uv sequence?
Post by: newton on December 26, 2012, 02:20:09 pm
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.
Title: Re: how to modify uv sequence?
Post by: EgonOlsen on December 26, 2012, 03:58:38 pm
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.
Title: Re: how to modify uv sequence?
Post by: newton on December 27, 2012, 02:48:16 am
I have noticed that. Only 1 fps by using Pologon Manager. I'll try the texture matrix.Thank you.
Title: Re: how to modify uv sequence?
Post by: EgonOlsen on December 27, 2012, 09:22:06 am
1fps seems to be pretty low even when using that inefficient method. What's the polygon count of your mesh?
Title: Re: how to modify uv sequence?
Post by: newton on December 27, 2012, 09:38:12 am
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?
Title: Re: how to modify uv sequence?
Post by: EgonOlsen on December 27, 2012, 12:22:13 pm
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.
Title: Re: how to modify uv sequence?
Post by: newton on December 27, 2012, 12:32:00 pm
128 * 128 vertices. Every 3 nearest vertices construct a triangle.