Mohammad Haseeb’s Blog | Tag Archive | filled
1 0 Tag Archives: filled
It has been so long since I wrote a technical or programming post. One reason is that I am busy with an awesome social game project at the company I’m working with right now, White Rabbit Online. I’m having a great time with the project but have also been working with Papersteer, more on that in another post.
While working with Papersteer, I created many solutions for the ActionScript world and I learned a lot as well. During this time, I came along a problem which required me to create filled circles using Papervision. Initially, I searched around the net and found Seb’s 3D Circle post. However, that did not solve my problem and I needed filled 3d circles/disks. I looked into Vectorvision for Pv3D as well but the absence of true 3D geometry forced me to trash that as well.
I missed TriangleFan because I’ve used in C# and other platforms. So, I went ahead and tried to simulate a TriangleFan algorithm. It didn’t take me long and all I needed to do was create a rotated path for the common triangle vectors. Voila, see below:
Patterns? . Click on the snapshot below to view the original image. This one uses 500 segments to draw the circle.
There may be better ways to make this. If there are, do let me know. Download the source with demo here