Hey! Fabice3D

This Sample Code make me understand for lathe class,i just start try to work
with lathe and so many confuse for a while ;)

Thanks,
Kapom

On Wed, Nov 25, 2009 at 7:56 PM, Fabrice3D <[email protected]> wrote:

> Well done! That's one way to do it, say the hard way.
> So now, you know how to freak around with faces!
>
> Now let me piss you off a bit with the other (easy) way I did'nt mention in
> previous mail.
> To do this particular shape,  simply use the Lathe class like this:
>
> var easyway:Lathe = new Lathe([new Number3D(0,-100,0),new
> Number3D(-100,-100,0) new Number3D(-100,100,0), new Number3D(0,100,0)],
> {flip:true, recenter:false, subdivision:4, material:mat});
>
> done!  :))
>
> Fabrice
>
>
>
>
> On Nov 25, 2009, at 1:33 PM, davivid wrote:
>
> cheers Fabrice,
>>
>> just what I needed to get me going. I've got it working, and seems to
>> be fine - although im quite sure my method of trial and error is not
>> the best way... Once I found the top faces, I noted them, and deleted
>> them. I then created the new 4 faces based on the old two, and went
>> through each of the new faces changing the vertices until everything
>> lined up. Next I cycled through the vertices of the cube, and slotted
>> these into my new faces where they matched.
>>
>> I'm now wondering if there is likely to be any issues with the way I
>> have done it? as Im after as much performance as possible. Or is there
>> a better way of doing this? thanks.
>>
>> pointedCube = new Cube( { width:200, height:200, depth:200 } );
>> view.scene.addChild(pointedCube);
>>
>> pointedCube.removeFace(pointedCube.faces[8]);
>> pointedCube.removeFace(pointedCube.faces[8]); //originally face 9
>>
>> var pointheight:Vertex = new Vertex(0, pointedCube.height, 0); //
>> Vertex for Point
>>
>> var one:Face = new Face(pointedCube.vertices[2], pointedCube.vertices
>> [6], pointheight,new ColorMaterial(0xff0000));
>> var two:Face = new Face(pointedCube.vertices[0], pointheight,
>> pointedCube.vertices[5],new ColorMaterial(0x00ff00));
>> var three:Face = new Face(pointedCube.vertices[2], pointheight,
>> pointedCube.vertices[0],new ColorMaterial(0x0000ff));
>> var four:Face = new Face(pointheight, pointedCube.vertices[6],
>> pointedCube.vertices[5],new ColorMaterial(0xccff00));
>>
>> pointedCube.addFace(one);
>> pointedCube.addFace(two);
>> pointedCube.addFace(three);
>> pointedCube.addFace(four);
>>
>>
>>
>> On Nov 25, 11:30 am, Fabrice3D <[email protected]> wrote:
>>
>>> sure, just insolate the two faces on top
>>> note the four vertexes, delete the faces
>>> and add four new faces.
>>>
>>> Fabrice
>>>
>>> On Nov 25, 2009, at 11:18 AM, davivid wrote:
>>>
>>> Is it possible to modify the cube primitive in such a way that an
>>>> extra vertex is added to the centre of say the top the face, and moved
>>>> up to created a pointed/pyramid effect?
>>>>
>>>
>>> like this:
>>>> http://away3d-dev.googlegroups.com/web/pointedcube.jpg
>>>>
>>>
>>> thanks.
>>>>
>>>
>


-- 
http://www.kapom.com

Reply via email to