Filled Disk/Circle with TriangleFan in Papervision3D

Hey guys,

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? :D. 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

Related posts:

  1. Crazy Flocking in PaperVision3D
  2. Attention Everyone… (as3steer, papersteer, r4 visualiser updates)
  3. FreeCamera3DController for PaperVision3D
  4. Smoke Particle System in PaperVision3D
  5. Artificial Behavior in PaperVision3D

This entry was posted on Wednesday, December 8th, 2010 at 9:50 pm

You can follow any responses to this entry through the RSS 2.0 feed.

Tags: 3d, as3, circle, disk, filled, papervision3d, pv3d, trianglefan

Posted in: 3d, ActionScript, Graphics, MicroHard, Open Source, papervision3d, Programming