www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Gatobot14 on January 23, 2016, 02:49:35 pm

Title: change textures coordinates
Post by: Gatobot14 on January 23, 2016, 02:49:35 pm
Its posible for an animated object (bones object) to use setTextureMatrix???
Title: Re: change textures coordinates
Post by: EgonOlsen on January 23, 2016, 02:54:20 pm
Yes, why shouldn't it?
Title: Re: change textures coordinates
Post by: Gatobot14 on January 24, 2016, 01:13:19 am
Docs says that works better on compiled objects and i dont know if bones objects are compiled, and after reading this ,
its good practice to use compiled objects? what are the benefits, or limitations?? i only call build
Title: Re: change textures coordinates
Post by: EgonOlsen on January 24, 2016, 10:56:24 am
The wiki has a section on compiled objects. Basically, it's a good idea to use them, because they are much faster in most cases. If using them on animated objects, you have to make sure to compile them in dynamic mode and for Bones, you have to call touch() on an animated object after applying an animation, because otherwise, it won't recognize the change.
jPCT-AE always uses compiled objects BTW.
Title: Re: change textures coordinates
Post by: Gatobot14 on January 25, 2016, 02:58:29 pm
Ok now setTexturesMatrix only work in stage 0, i have my textures in one texture atlas, if i need to set another texture layer in my object, how can i move textures coordinates for the second layer?
Title: Re: change textures coordinates
Post by: EgonOlsen on January 25, 2016, 04:25:23 pm
If you don't specify anything else, the texture coordinates for the second stage will be the same the ones for the first if you assign a TextureInfo instance with 2 stages.
Title: Re: change textures coordinates
Post by: Gatobot14 on January 25, 2016, 10:28:02 pm
But i will be able to move the coordinates for the second layer? Suppose i dont want the second layer be in same position like the first, example: in a texture atlas i have my first texture in first tile and my second texture in the fourth tile, is this possible?
Title: Re: change textures coordinates
Post by: EgonOlsen on January 25, 2016, 10:37:16 pm
...not sure what you mean exactly...!?
Title: Re: change textures coordinates
Post by: Gatobot14 on January 27, 2016, 03:45:36 am
if setTextureMatrix changes coordinates for first layer, how can i change coordinates for second layer?
Title: Re: change textures coordinates
Post by: EgonOlsen on January 27, 2016, 07:27:06 am
By default, you can't. You would have to use your own custom shader to do that.
Title: Re: change textures coordinates
Post by: Gatobot14 on January 29, 2016, 05:36:16 am
perfect thanks for your patience jeje ::)
Title: Re: change textures coordinates
Post by: EgonOlsen on May 24, 2016, 08:58:44 pm
 ??? Which game?