Author Topic: Hi! everyone !does JPCT Object3D support dynamic textures?  (Read 1709 times)

Offline fooyou

  • byte
  • *
  • Posts: 8
    • View Profile
Hi ! EgonOlsen! and everyone ! I have question to consult !  I want to know if JPCT support dynamic textures? for example .
I get  a model ,rabbit with skin a animation made by 3ds Max tool !  and it was mapped a texture ,a image. especially, when playing  the animation . it needs change  texture UV ,in other words !a same part of an Objcet3D (not all Object3D), at different time ,it should have different texture.  just like a people undress a clothes and show the inside clothes.


thks!
  Fooyou!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Hi! everyone !does JPCT Object3D support dynamic textures?
« Reply #1 on: June 25, 2013, 01:29:56 pm »
Yes, you can do that. The best way is to put the textures in one texture atlas (i.e. stuff them all togther in one texture) and switch them by using a texture matrix (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setTextureMatrix(com.threed.jpct.Matrix)) or you can change uv-mapping at runtime using the PolygonManager and compile it using Object3D.compile(true, true);(http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#compile(boolean, boolean))

Offline fooyou

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Hi! everyone !does JPCT Object3D support dynamic textures?
« Reply #2 on: June 26, 2013, 03:29:01 am »
Thank you for reply! EgonOlsen! I will have  a try!

Offline fooyou

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Hi! everyone !does JPCT Object3D support dynamic textures?
« Reply #3 on: June 26, 2013, 05:29:17 am »
Hi ! I come back !  I cant resolve the problem ! I cant  let it work fine ! then  I have try 2 suggestion what your gave me! But , it looks some trouble . First , I use method  setTextureMatrix(mat) ,I dont know  how to get  the  Matrix  value ? where does the value come from? How do I calculate the value, if I should know accurate coordination of UV coords? My artist just gave me a model and a texture image ,but coordination .  in addition , I dont know which animation frame and when need change matrix . because  of no animation sequence  info from my artist !
https://docs.google.com/file/d/0By_KX7XayXSlQlp3OUh0R25ZMHM/edit?pli=1
here is my demo resource , a compress  file contain  a  video showing the animation and  an Android APK file  of my demo project , at last , an image file UV texture . could you help me , take you a few minutes  to see . maybe  U can understand what I said! note the video , there is a rabbit winking ,  the eyes of the rabbit should show different image ,a star when winking ! but my apk cant do that!
           
           Thank you !
           by Fooyou

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Hi! everyone !does JPCT Object3D support dynamic textures?
« Reply #4 on: June 26, 2013, 09:36:15 pm »
The matrix is a normal transformation matrix, i.e. the uv-values will be multiplied with it. Reading your post again, it might not be appropriate for your task. However, i'm not 100% sure what you actually want to do. Do want to change uv-coordinates or parts of the texturing but without changing uv (your clothes example implies this) or do you want to change the complete texture?

Offline fooyou

  • byte
  • *
  • Posts: 8
    • View Profile
Re: Hi! everyone !does JPCT Object3D support dynamic textures?
« Reply #5 on: June 27, 2013, 03:32:49 am »
 yep! I just  want to change parts of the texturing , not to change the complete texture! for example , the mouth of the rabbit or the head of the rabbit  when playing  animation at different  frame ! does it can be work ??