For example, consider if someone wanted to draw a pie graph on some terrain. But the graph lays on top of the terrain. In my case, I just want to draw a circle on top of a Cube.
I suppose I could draw a 3D disc if I had to. Any thoughts?
Answer by e.bonneville
Feb 03, 2011 at 07:07 PM
You could use a projector placed above the cube or you could manually place a plane with the pie graph texture on it directly above the cube.
However, if all you wanted to do was simply draw a solid circle of one color, you could create a cylinder gameObject, set the Y scale to something like .01, place that cylinder above your cube, set the material's color to whatever color you need, and scale that using Vector3.Scale.
The only problem with using a texture is that I want the circle to be able to grow/shrink as the user moves a slider.
But I'll try the Projector approach.
Hmm... so what if I use the Projector approach but still want a circle to grow/shrink? Is this going to be possible?
Yup, all you have to do is set the projector to orthographic, then change the projector's A) height above the cube or B) orthographic size. Here's the script reference for projectors: http://unity3d.com/support/documentation/ScriptReference/Projector.html
Also, don't forget to accept and upvote this Answer if it works for you. ;)
Thanks! And don't worry, I won't ;)
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users post good questions and use the site effectively we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
1 Person is following this question.
circle image on a cylinder?
Limit Mouse Look to Circle
Find tangent points on circle
Spawn prefabs in a circle?
Multiple UI drawn circles, how to cut out any of the overlapping circles?