The rotations are not ment to define the directional orientation of the path
think about rails, when you approach a turn the train is not straight, it has
that little orienation to the curve..
this rotation is not defined by the curve definition, its an additional factor.
In the Path class, they define this "rotation" factor per destination points
you have now defined 3 for 2 lines, that one too much hence the null object
Best way to understand is to make the path first without them, extrude
something.
Then pass this array, may be add one by one these rotation. Note that the last
entry of the array is applied to the rest of the path definition
Fabrice
On Dec 15, 2010, at 8:24 PM, colouredfunk wrote:
> Hello,
>
> I am trying to create a simple line between several points/objects in
> my 3D scene.
>
> The line doesn’t need to have any curves but it would need to be
> around 50 pixels wide. The points will be in all different positions
> so the line will need to retain it's shape on angles etc...
>
> I’m using the following code that I’ve taken from various examples,
> but I get a compile error ([Fault] exception, information=TypeError:
> Error #1009: Cannot access a property or method of a null object
> reference. (PathUtils.as) when I use my pos Array for the path.
>
> Please can someone help me out.
>
> Many many thanks
>
>
>
> var mat:Material = new WireframeMaterial("yellow", {width:20});
> var pos:Array = new Array
> for each (var obj3D:Object3D in room.children)
> {
> if (obj3D.name.substr(0,3) == "Box")
> pos.push(obj3D.position);
>
> }
> var aPath:Path = new Path(pos)
>
> var aPoints:Array = [];
> aPoints.push(new Vector3D(-100, 0, 0));
> aPoints.push(new Vector3D(-50, 0, 0));
> aPoints.push(new Vector3D(-50, -50, 0));
>
>
> var rotationPoints:Array = new Array();
> rotationPoints.push(new Vector3D(0, 0, 0));
> rotationPoints.push(new Vector3D(-20, 0, 0));
> rotationPoints.push(new Vector3D(20, 0, 0));
>
> var pathextrude:PathExtrusion = new PathExtrusion(aPath, aPoints,
> null, rotationPoints, { flip:true, aligntopath:true, coverall:false,
> scaling:1, recenter:true, material:mat, subdivision:18 } );
> scene.addChild(pathextrude);