If you need a PV3D curve, you can use the attached Bezier3D class. It
uses multiple Line3D instances (default segmentation is 10) to simulate
a quadric bezier curve, giving you pretty much the drawing API's
curveTo() functionality in 3D. Usage is, i hope, quite self-explanatory :D
It will also explain you how segmentation is done - just look at the
build() method. If you want to change the shape of Bezier3D run-time
(changing properties than calling rebuild() method), you should also
edit Lines3D class from PV3D and replace it's removeLine() method
because it doesn't remove vertices when removing a line. Replace the
removeLine() method with something like:
public function removeLine(line:Line3D):void
{
var lineindex : int = lines.indexOf(line);
if(lineindex>-1)
{
var vertices:Array = geometry.vertices;
var c_v0:int = vertices.indexOf(line.v0);
if(c_v0 != -1) vertices.splice(c_v0, 1);
var c_v1:int = vertices.indexOf(line.v1);
if(c_v1 != -1) vertices.splice(c_v1, 1);
lines.splice(lineindex,1);
}
else if(Papervision3D.VERBOSE)
{
trace("Papervision3D Lines3D.removeLine : WARNING
removal of non-existant line attempted. ");
}
}
That should do the trick... Until I finish my Graphics3D extension for
PV3D :)
Cheers...
Tim Knip wrote:
> Hi list,
>
> I have a curved line (curveTo)...
>
> How to get straight line-segments following this curve?
> Where start- and endpoints of the segments lie on the curve .
>
> Say I have a circle created from 4 curveTo's. How do I create like 16
> straight line segments?
>
> Thanks!
> Tim
>
> _______________________________________________
> Papervision3D mailing list
>
Papervision3D@...
>
http://osflash.org/mailman/listinfo/papervision3d_osflash.org>
>
_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org