Author Topic: UI3dModel to allow better 3d model integration as widgets?  (Read 2761 times)

sisso

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 46
    • View Profile
UI3dModel to allow better 3d model integration as widgets?
« on: June 20, 2013, 07:30:54 AM »
Hi,

Sometimes I need to change some Widget by a 3D model. Most of cases is ok, but some like DraggablePanels restrictions didn't work because it didn't know about 3D bounds.

I was thinking about a UI3dModel computes the bounds my model renderer or by a UIFixedSize where you define your bounds manually.

I understand that some features like shader clipping will not work, but NGUI there is a lot of functionallity and behavior that will be easy to use without duplicate my code.

I am in the correct way?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI3dModel to allow better 3d model integration as widgets?
« Reply #1 on: June 20, 2013, 07:32:15 AM »
If you need to display 3D models with your 2D UIs, then you should render 3D models into thumbnails (textures) that you then display using the UI. This way the UI stays flat.

sisso

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 46
    • View Profile
Re: UI3dModel to allow better 3d model integration as widgets?
« Reply #2 on: June 20, 2013, 08:09:11 AM »
If you need to display 3D models with your 2D UIs, then you should render 3D models into thumbnails (textures) that you then display using the UI. This way the UI stays flat.

Sorry, but it make no sense. The point is that I don't want to use something 2d. 3d model have the ability to rotate, animate and apply effects. I am talking about make integration easy, even if partial.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI3dModel to allow better 3d model integration as widgets?
« Reply #3 on: June 20, 2013, 01:28:52 PM »
Set up an off-screen camera to render into a render texture. Use a UITexture to draw this render texture. You get 3D in a 2D environment.

sisso

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 46
    • View Profile
Re: UI3dModel to allow better 3d model integration as widgets?
« Reply #4 on: July 02, 2013, 11:47:17 AM »
If someone need it.

For simple needs, I simple create a sprite with alpha 0 to make the 3d object bounds. Any other NGUI stuff like drag panels will work fine.