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!
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) (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) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#compile(boolean,%20boolean)))
Thank you for reply! EgonOlsen! I will have a try!
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
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?
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 ??