Author Topic: how to modify uv sequence?  (Read 1496 times)

Offline newton

  • byte
  • *
  • Posts: 8
    • View Profile
how to modify uv sequence?
« 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"));

Offline newton

  • byte
  • *
  • Posts: 8
    • View Profile
Re: how to modify uv sequence?
« Reply #1 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11968
    • View Profile
    • http://www.jpct.net
Re: how to modify uv sequence?
« Reply #2 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.

Offline newton

  • byte
  • *
  • Posts: 8
    • View Profile
Re: how to modify uv sequence?
« Reply #3 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11968
    • View Profile
    • http://www.jpct.net
Re: how to modify uv sequence?
« Reply #4 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?

Offline newton

  • byte
  • *
  • Posts: 8
    • View Profile
Re: how to modify uv sequence?
« Reply #5 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11968
    • View Profile
    • http://www.jpct.net
Re: how to modify uv sequence?
« Reply #6 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.

Offline newton

  • byte
  • *
  • Posts: 8
    • View Profile
Re: how to modify uv sequence?
« Reply #7 on: December 27, 2012, 12:32:00 pm »
128 * 128 vertices. Every 3 nearest vertices construct a triangle.