[Papervision3D] Drawing Circles
Carlos Ulloa
carlos at papervision3d.org
Wed Dec 10 06:31:44 PST 2008
Since last sunday. :)
Check out Mr Lindquist's tutorial from the next day:
http://pv3d.org/2008/12/08/vectorvision-hello-world/
C4
On 10 Dec 2008, at 13:45, Pablo Lemos wrote:
> Since we´re talking about vectors...
> Mark, Seb, core team: when VectorVision will be just Papervision?
>
> Pablo Cabana
> (21) 9338-0388
> Cabana Criação
> (21) 2707-7020
> www.cabanacriacao.com
> Visite também o Cabanoblog:
> www.cabanacriacao.com/blog
>
> ----- Original Message ----- From: "Seb Lee-Delisle" <sebstar55 at gmail.com
> >
> To: <papervision3d at osflash.org>
> Sent: Wednesday, December 10, 2008 11:15 AM
> Subject: Re: [Papervision3D] Drawing Circles
>
>
>> ah yes erm... i really need to learn vectorvision... sorry Mark!
>>
>> Seb Lee-Delisle
>> Technical Director
>> pluginmedia.net
>>
>>
>>
>>
>> On Wed, Dec 10, 2008 at 12:34 PM, Mark Barcinski
>> <barcinski at gmail.com> wrote:
>>> :)
>>>
>>> On Dec 10, 2008, at 1:19 PM, Seb Lee-Delisle wrote:
>>>
>>>> Here's my Circle3D class that extends Lines3D, and draws a
>>>> perfectly
>>>> smooth curved circle or arc. Hope it helps! Same licence as the
>>>> rest
>>>> of the Papervision3D code.
>>>>
>>>> Seb Lee-Delisle
>>>> Technical Director
>>>> pluginmedia.net
>>>>
>>>>
>>>> -----------------------------------------------------------------------------------------------------
>>>>
>>>> package net.pluginmedia.pv3d
>>>> {
>>>> import org.papervision3d.core.geom.Lines3D;
>>>> import org.papervision3d.core.geom.renderables.Line3D;
>>>> import org.papervision3d.core.geom.renderables.Vertex3D;
>>>> import org.papervision3d.core.math.Number3D;
>>>> import org.papervision3d.materials.special.LineMaterial;
>>>>
>>>> public class Circle3D extends Lines3D
>>>> {
>>>> public function Circle3D(mat:LineMaterial, radius :
>>>> Number=100,
>>>> divisions : int = 8, lineWeight : Number = 2, startAngle : Number
>>>> = 0,
>>>> endAngle : Number = 360)
>>>> {
>>>> super(mat);
>>>> addCircle(0,0,0,radius, divisions,
>>>> startAngle,
>>>> endAngle, lineWeight);
>>>> }
>>>>
>>>> public function addCircle(x:Number, y:Number,
>>>> z:Number,
>>>> r:Number,
>>>> d:Number = 8, startAngle:Number =0, endAngle:Number = 360,
>>>> linethickness:Number = 2):void
>>>> {
>>>> var temp : Number3D = new Number3D(r,0,0);
>>>> var tempcurve:Number3D = new Number3D(0,0,0);
>>>> var joinends : Boolean;
>>>> var i:int;
>>>> var pointcount : int;
>>>>
>>>> var angle:Number = (endAngle-startAngle)/d;
>>>> var curveangle : Number = angle/2;
>>>>
>>>> tempcurve.x = r/Math.cos(curveangle *
>>>> Number3D.toRADIANS);
>>>> tempcurve.rotateY(curveangle+startAngle);
>>>>
>>>> if(endAngle-startAngle<360)
>>>> {
>>>> joinends = false;
>>>> pointcount = d+1;
>>>> }
>>>> else
>>>> {
>>>> joinends = true;
>>>> pointcount = d;
>>>> }
>>>>
>>>>
>>>>
>>>> temp.rotateY(startAngle);
>>>>
>>>> var vertices:Array = new Array();
>>>> var curvepoints:Array = new Array();
>>>>
>>>> for(i = 0; i< pointcount;i++)
>>>> {
>>>> vertices.push(new Vertex3D(x+temp.x,
>>>> y+temp.y, z+temp.z));
>>>> curvepoints.push(new
>>>> Vertex3D(x+tempcurve.x, y+tempcurve.y, z+tempcurve.z));
>>>> temp.rotateY(angle);
>>>> tempcurve.rotateY(angle);
>>>> }
>>>>
>>>> for(i = 0; i < d ;i++)
>>>> {
>>>> var line:Line3D = new Line3D(this,
>>>> material
>>>> as LineMaterial,
>>>> linethickness, vertices[i], vertices[(i+1)%vertices.length]);
>>>>
>>>> line.addControlVertex(curvepoints[i].x,
>>>> curvepoints[i].y,
>>>> curvepoints[i].z );
>>>>
>>>> addLine(line);
>>>> }
>>>>
>>>>
>>>>
>>>> }
>>>>
>>>> }
>>>> }
>>>>
>>>>
>>>> ----------------------------------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>> On Wed, Dec 10, 2008 at 12:14 PM, James <pv3d at zavoo.com> wrote:
>>>>>
>>>>> You could try drawing the circle on a Shape.
>>>>> Then convert the Shape to a material on a Plane.
>>>>>
>>>>> James
>>>>>
>>>>> Sascha wrote:
>>>>>>
>>>>>> Is there a good method to draw a 3D Circle with PV3D? The
>>>>>> closest thing
>>>>>> I've
>>>>>> found so far is a Bezier3D but a circle should be much easier
>>>>>> to draw
>>>>>> than
>>>>>> with these. I need this to represent the Orbit of several Planets
>>>>>> orbiting
>>>>>> around a Star.
>>>>>>
>>>>>> Sascha
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Papervision3D mailing list
>>>>>> Papervision3D at osflash.org
>>>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Papervision3D mailing list
>>>>> Papervision3D at osflash.org
>>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>>>
>>>>
>>>> _______________________________________________
>>>> Papervision3D mailing list
>>>> Papervision3D at osflash.org
>>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
More information about the Papervision3D
mailing list