- Home /
Drawing Sector around GameObject in GameView: GUITexture or 3D Object
What is an efficient way to draw a sector around a gameobject as shown below?
From the forums I read about drawing via Gizmos (not applicable in GameView), Projections, GUITextures and drawing a Textured 3D cylinder/sphere GameObject (would it work?) to probably achieve this effect.
Between GUITexture vs 3D cylinder/sphere approach what would be better?
Projections I read, might take up too many draw calls.
An equivalent of Handles.DrawSolidArc for the GameView?
Answer by Berenger · Mar 08, 2012 at 12:37 AM
For what I understand, Projectors (that's what you mean by projection ?) redraw the things they touch, so that's a lot of draw calls. I'd say go with a plane shaped as a triangle with a transparent unlit shader.
Thanks Berenger! Those pointers are helpful! I've never done rendering before so I'll look this up, experiment and get back to you if I have trouble.
A triangle shaped plane would be a mesh created via a script, right?
Script or 3D App yes. But it could also be the default plane with a white triangle on a black background texture and a transparent shader.
If you're interested, here is a script I did a few weeks ago for an AI cone sight. It's generating a ... whatever the geomertic term for pie slice is, and use raycast to be occluded by obstacles. It's commented in french though, you might need google translate :p
Thank you! We've made some progress with your idea! What is the best way to make the length of the SolidArc dynamic? I can think of scaling the plane. If there's another, kindly lend your thoughts.
Your answer
Follow this Question
Related Questions
OnMouseExit Problems vs. RaycastAll 2 Answers
Move GUITexture with mouse 2 Answers
I want to place guitexture with a mouse. 0 Answers
Limit Mouse Look to Circle 1 Answer
Camera movement question 1 Answer