Author Topic: Change UV  (Read 2526 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Change UV
« on: June 26, 2011, 11:25:04 am »
How to change UV on plane? Is there any method like setUV() on vertex?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Change UV
« Reply #1 on: June 26, 2011, 10:20:38 pm »
Yes, the PolygonManager allows you to set a polygons texture and that includes uv...this works only if the object hasn't been stripped and if it has been build by calling build(false);. After modifying the coordinates, touch() has to be called on the object to promote the changes. However, updating uv isn't particularly fast. You might want to consider to use a texture matrix instead...that might not work on some older phones (like G1), but if you target newer devices only, that doesn't matter.

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Change UV
« Reply #2 on: June 26, 2011, 10:27:50 pm »
I want to do some scale effect, object is for collisions, so I will try apply scale matrix on texture...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Change UV
« Reply #3 on: June 26, 2011, 10:36:55 pm »
Yes, that should be easier and faster.