Textures merging/overlaying

Started by spacelobster, March 15, 2017, 09:18:09 PM

Previous topic - Next topic

spacelobster

Hello everyone!

F. E. we have a 3d mesh of cilinder. We can zoome it, move it, rotate it, etc. The mesh has some texture applied.
Then we are having a 2D image (as plane f.e) that's possible to zoome it, move it, rotate it, etc separate from cilinder.

My question: is it possible to apply (map?) 2D image on the cilinder mesh, on certain place, so it'll take a mesh's shape and will not loose proportions?
So it kinda becomes a part of cilinder's texture. Do we have any example (or at least direction to move) how to do it with jpct-ae?

Sorry for such a noob's example, I'm not sure how this process properly called :)
Thank you!

EgonOlsen

I'm not sure what you mean...do have a picture to illustrate it?

spacelobster

Sorry for that, I'll try to explain better and with image :)



On the image you can see the fish on the cube. Imagine that from the beginning we had only 3D mesh of the cube and 2D image of the fish.
Then we somehow applied fish on this certain position of the cube.

So, my question is - how it works and how it's possible to do with jpct-ae?

Thank you!



EgonOlsen

You can add an additional texture layer (see TextureInfo class) that contains a texture with the fish and an alpha channel. However, if you want the fish to be rendered on just one side of the cube, you would either have to modify the Object3D by using the PolygonManager to add the additional layer to just two of its polygons or you have to create the cube in code yourself.

spacelobster

Thank you very much, I'll try this out  :D