Hello Guest

Author Topic: Camera Gizmo  (Read 3876 times)

Daiflys

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Camera Gizmo
« on: May 15, 2014, 11:26:55 am »
Hello!
I want to draw the gizmos for the camera view (the green bounds that appear when you select a camera) permanently.
I tried a lot of things but i can't grab the correct values for the camera to draw the gizmos appropiately.
Can anyone tell me what i have to put in the camera OnDrawGizmos function to draw the gizmo well?
Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Camera Gizmo
« Reply #1 on: May 15, 2014, 10:06:35 pm »
Check tk2dCameraEditor.OnSceneGUI - thats where it draws the bounds right now. Basically, you get the projection matrices, transform a unit cube by the inverse of the matrix to get the view space frustum and draw that. If you folow the function through to DrawCamera bounds, it'll probably be possible to implement it in ondrawgizmos, but expect to do a bit of work there.