Author Topic: Textures merging/overlaying  (Read 2579 times)

Offline spacelobster

  • byte
  • *
  • Posts: 3
    • View Profile
Textures merging/overlaying
« on: March 15, 2017, 09:18:09 pm »
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!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Textures merging/overlaying
« Reply #1 on: March 16, 2017, 08:37:34 am »
I'm not sure what you mean...do have a picture to illustrate it?

Offline spacelobster

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Textures merging/overlaying
« Reply #2 on: March 16, 2017, 03:04:13 pm »
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!



Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Textures merging/overlaying
« Reply #3 on: March 17, 2017, 08:35:57 am »
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.

Offline spacelobster

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Textures merging/overlaying
« Reply #4 on: March 17, 2017, 01:41:10 pm »
Thank you very much, I'll try this out  :D