Author Topic: How to display 2D image to 3D screen  (Read 66 times)

Offline Hellfire

  • byte
  • *
  • Posts: 3
    • View Profile
How to display 2D image to 3D screen
« on: November 21, 2022, 12:13:39 pm »
Hello friends. How to display 2D Image to the camera?
I'am trying to make a Joystick

Offline AeroShark333

  • float
  • ****
  • Posts: 310
    • View Profile
Re: How to display 2D image to 3D screen
« Reply #1 on: November 21, 2022, 10:27:21 pm »
Hello welcome!

Hello friends. How to display 2D Image to the camera?
I'am trying to make a Joystick
I'd recommend the blitting functions of the FrameBuffer:
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/FrameBuffer.html#blit-com.threed.jpct.Texture-float-float-float-float-float-float-float-float-int-boolean-

I hope this helps :)

Offline Hellfire

  • byte
  • *
  • Posts: 3
    • View Profile
Re: How to display 2D image to 3D screen
« Reply #2 on: November 22, 2022, 12:39:50 pm »
Hello welcome!

Hello friends. How to display 2D Image to the camera?
I'am trying to make a Joystick
I'd recommend the blitting functions of the FrameBuffer:
https://www.jpct.net/jpct-ae/doc/com/threed/jpct/FrameBuffer.html#blit-com.threed.jpct.Texture-float-float-float-float-float-float-float-float-int-boolean-

I hope this helps :)
Thank you, its working, i didn't have the perfect texture though  ::) ::)

Offline AeroShark333

  • float
  • ****
  • Posts: 310
    • View Profile
Re: How to display 2D image to 3D screen
« Reply #3 on: November 22, 2022, 03:05:15 pm »
Thank you, its working, i didn't have the perfect texture though  ::) ::)
Glad to hear!

For a joystick, I'd recommend a PNG file as texture (where the outside is transparent), otherwise a JPG texture (where the outside is black).
Make sure to use the constructors in Texture that have 'useAlpha' (which you should then set to true): https://www.jpct.net/jpct-ae/doc/com/threed/jpct/Texture.html#Texture-Bitmap-boolean-