Hiya,

What you describe is probably exacly what I need to do.  This is
mostly my inexperience with AS3 showing. I am just having a problem
making the class return the LatheExtrusion as a Mesh that I can then
pick up on and display.


I just need a Class that I can use to generate a LatheExtrusion
multiple times.

var model01:RoundTube = new RoundTube(10, 2, 300);
var model02:RoundTube = new RoundTube(10, 5, 150);
var model03:RoundTube = new RoundTube(14, 2, 60);

I'll continue to slog on.  I have a few more things I can try.  I'll
let you know if I get anywhere.

Thanks.


On Apr 1, 2:29 pm, Fabrice3D <[email protected]> wrote:
> why don't you explain what you want to do exactly.
> this class extends Object3D and has a mesh generator build a mesh, which is 
> already extending Object3D...
>
> simply make a static class that returns you an instance LatheExtrusion as Mesh
>
> in your main code simply import this class
> and say
>
> var myTube:Mesh = MagicTubeMaker.pleaseDoYourThing(depth, thickness, etc);
>
> On Apr 1, 2011, at 3:11 PM, Melanikus wrote:
>
> > Hiya,
>
> > Thanks for your response Fabrice.  I have tried it out in the Main
> > code and it seems to work fine.  However I am still haveing problems
> > when I try creating a new Class outside the main code using the
> > LatheExtrusion method.  I think it is simply down to my lack of
> > knowledge about class structures and which classes extend others.  At
> > the moment, calling this Class results in a blank screen, although the
> > end trace is called, so the Class is being called and run through.
>
> > Here is my cut down version of the code using the new profile:
>
> > [code]
> > package {
> >    import flash.display.*;
> >    import flash.geom.Vector3D;
>
> >    import away3d.arcane;
> >    import away3d.extrusions.*;
> >    import away3d.materials.*;
> >    import away3d.core.utils.*;
> >    import away3d.core.base.*;
>
> >    public class RoundTube extends Object3D {
>
> >            public function RoundTube(radius:Number, thickness:Number,
> > depth:Number, init:Object = null):void {
> >                    super(init);
> >                    drawRoundTube(radius, thickness, depth);
> >            }
>
> >            //draw round tube
> >            public function drawRoundTube(radius:Number, thickness:Number,
> > depth:Number):void {
> >                    var profile:Array = [
> >                            new Vector3D(-radius, depth, 0),
> >                            new Vector3D(-radius, 0, 0)
> >                    ];
>
> >                    var roundTube:LatheExtrusion = new 
> > LatheExtrusion(profile);
> >                    roundTube.subdivision = 18;
> >                    roundTube.thickness = thickness;
> >                    roundTube.centerMesh = false;
> >                    roundTube.revolutions = 1;
> >                    roundTube.bothsides = false;
>
> >                    //flips the model over
> >                    roundTube.rotationX = -90;
>
> >                    var wMaterial:WireColorMaterial = new 
> > WireColorMaterial(0x373737);
> >                    wMaterial.wireColor = 0x373737;
> >                    roundTube.material = wMaterial;
>
> >                    //add to holder
> >                    //addChild(roundTube);
>
> >                    trace("model complete");
>
> >            }
>
> >    }
> > }
> > [/code]
>
> > On Apr 1, 11:55 am, Fabrice3D <[email protected]> wrote:
> >> You think too complex!
> >> A single straight line, (PathSegment or PathCommand for 3.6)as profile is 
> >> enough, such as -100,0,0 0,0,0 100, 0,0
> >> Check the Broomstick example class, I've pushed few rings in there, 
> >> inclusive one with thickness which is exactly what you want.
>
> >> Even if slightly different from 3.x engine version, the profile principle 
> >> is exactly the same.
>
> >> Fabrice
>
>

Reply via email to