Hi,

I'm actually having a similar issue (mapping faces to a mesh to make a
plane, so I can manipulate vertices accordingly a physics system I'm
using), but setting bothsides to false creates the alternating
triangle issue much like the PNG Jim posted in the OP.
Is the order of the vertices I define for the face the cause for it
not appearing, or because it it is using vertices already used by the
previous face? Is there any way to set the indices between two faces
to diminish the number of vertices overall? Any assistance anyone
could provide would be fantastic, thanks!

Matt


On Jan 18, 4:39 pm, jimalliban <[email protected]> wrote:
> OK then, my mistake.
>
> Building my own grid of triangles was definitely the long way round
> but from my perspective it gave me a great deal of easy access over
> the properties
>
> Thanks for your help
>
> Jim
>
> On Jan 18, 8:16 am, Fabrice3D <[email protected]> wrote:
>
> > and why wouldn't you not be able to change the materials?
> > depending on objects constructors, the materials are applied at face or 
> > object level.
> > if you clear at face level and nullify the object one. you have zero 
> > material.
> > then apply as you want, at face or mesh.material level.
>
> > Fabrice
> > On Jan 18, 2010, at 4:26 AM, jimalliban wrote:
>
> > > Thanks for your help Fabrice.
>
> > > I tried the Explode option but it wouldn't allow me to change the
> > > individual materials at various stages (not that you would know this
> > > was required as I never mentioned it).
>
> > > I went back to my previous method and fixed it by setting faceMaterial
> > > to null.
>
> > > Thanks again
>
> > > Jim
>
> > > On Jan 17, 9:02 pm, Fabrice3D <[email protected]> wrote:
> > >> Again, you can use the Explode class not only as generator of new meshes 
> > >> like in previous mail, but also it ensures that each face is not sharing 
> > >> any vertex with
> > >> another face. Just ignore the "unique mesh" boolean.
> > >> in short: you have all you need after you have use Explode with 
> > >> plane.faces array
> > >> you can animate, alter as with multiple meshes, except here you just 
> > >> need keep track of the indexes.
>
> > >> Fabrice
>
> > >> On Jan 17, 2010, at 8:40 PM, jimalliban wrote:
>
> > >>> Thanks Fabrice. I'll certainly give that a go if all else fails.
> > >>> Everything is currently in place to work with my system and scrapping
> > >>> that would mean more or less starting again.
>
> > >>> I basically need to have full control over all the triangles in a
> > >>> plane. This includes altering the vertices and individual materials.
>
> > >>> These additional triangles seem as though they are the result of a bug
> > >>> in the Away framework. Can't seem t get rid of them.
>
> > >>> On Jan 17, 7:05 pm, Fabrice3D <[email protected]> wrote:
> > >>>> dunno what you want to achieved exactly, but if you want all triangles 
> > >>>> to be independant,
> > >>>> you can do this in 3 or 4 lines of code...
>
> > >>>> step 1: var p:Plane = new Plane
> > >>>> step2: Explode(p, boolean as unique mesh);
>
> > >>>> done :)
>
> > >>>> nice to note here, that it works on any Mesh object, not just planes...
>
> > >>>> Fabrice
>
> > >>>> On Jan 17, 2010, at 4:46 AM, jimalliban wrote:
>
> > >>>>> Hi All
>
> > >>>>> I'm trying to make a grid of triangles to produce a plane that can be
> > >>>>> broken apart for an Augmented reality project. Each triangle needs to
> > >>>>> be double sided, but setting bothsides to true results in 2 triangles.
> > >>>>> One is the proper triangle in the correct place with the UV mapping.
> > >>>>> The other has all the default properties - 0, 0, 0, random
> > >>>>> ColorMaterial, 100 * 100 etc etc. Have a look at this image to see
> > >>>>> what I mean
>
> > >>>>>http://augmatic.co.uk/store/triangles.png
>
> > >>>>> It's not finished yet but here is the method:
>
> > >>>>>                private function buildTriangleGrid():void
> > >>>>>            {
> > >>>>>                    _triangles = new Vector.<Triangle>();
>
> > >>>>>                    var camelBmd:Camels = new Camels(0, 0);
> > >>>>>                    var camelMat:BitmapMaterial = new 
> > >>>>> BitmapMaterial(camelBmd);
>
> > >>>>>                    var gridWidth:int = _segW * _triangleSize;
> > >>>>>                    var griHeight:int = _segH * _triangleSize;
>
> > >>>>>                    var a:Vertex;
> > >>>>>                        var b:Vertex;
> > >>>>>                        var c:Vertex;
> > >>>>>                        var d:Vertex;
>
> > >>>>>                        var uva:UV;
> > >>>>>                        var uvb:UV;
> > >>>>>                        var uvc:UV;
> > >>>>>                        var uvd:UV;
>
> > >>>>>                    var i:int;
> > >>>>>                    var j:int;
> > >>>>>                    for (i = _segH; i >  0; i--)
> > >>>>>                    {
>
> > >>>>>                            for (j = 0; j < _segW * 2; j++)
> > >>>>>                            {
> > >>>>>                                    var triangle:Triangle = new 
> > >>>>> Triangle();
> > >>>>>                                    triangle.bothsides = true;
>
> > >>>>>                                    if (j % 2 == 0)
> > >>>>>                                    {
> > >>>>>                                            /*
> > >>>>>                                            0 __ 1
> > >>>>>                                             \      |
> > >>>>>                                               \    |
> > >>>>>                                                 \  |
> > >>>>>                                               \2
> > >>>>>                                            */
>
> > >>>>>                                            var halfJ:int = j * 0.5;
>
> > >>>>>                                            triangle.vertices[0] = new 
> > >>>>> Vertex(halfJ * _triangleSize -
> > >>>>> (gridWidth * 0.5),
> > >>>>>                                                                       
> > >>>>>                                              i * _triangleSize,
> > >>>>>                                                                       
> > >>>>>                                              0);
> > >>>>>                                            triangle.vertices[1] = new 
> > >>>>> Vertex((halfJ + 1) * _triangleSize -
> > >>>>> (gridWidth * 0.5),
> > >>>>>                                                                       
> > >>>>>                                              i * _triangleSize,
> > >>>>>                                                                       
> > >>>>>                                              0);
> > >>>>>                                            triangle.vertices[2] = new 
> > >>>>> Vertex((halfJ + 1) * _triangleSize -
> > >>>>> (gridWidth * 0.5),
> > >>>>>                                                                       
> > >>>>>                                              (i - 1) * _triangleSize,
> > >>>>>                                                                       
> > >>>>>                                              0);
>
> > >>>>>                                            a = triangle.vertices[0];
> > >>>>>                                                    b = 
> > >>>>> triangle.vertices[1];
> > >>>>>                                            c = triangle.vertices[2];
> > >>>>>                                            d = new Vertex(0, (i - 1) *
> > >>>>> _triangleSize, 0);
>
> > >>>>>                                           uva = new UV(0, 1);
> > >>>>>                                           uvb = new UV(1, 1);
> > >>>>>                                           uvc = new UV(1, 0);
> > >>>>>                                           uvd = new UV(0, 0);
> > >>>>>                                    }
> > >>>>>                                    else
> > >>>>>                                    {
>
> > >>>>>                                            /*
> > >>>>>                                            0
> > >>>>>                                            | \
> > >>>>>                                            |   \
> > >>>>>                                            |         \
> > >>>>>                                            1 ____2
> > >>>>>                                            */
>
> > >>>>>                                    }
> > >>>>>                                    triangle.addFace(new Face(a, b, c, 
> > >>>>> camelMat, uva, uvb, uvc));
> > >>>>>                                    _triangles.push(triangle);
> > >>>>>                                    addChild(triangle);
> > >>>>>                            }
> > >>>>>                    }
> > >>>>>            }
>
> > >>>>> Hope someone can help
>
> > >>>>> Cheers
>
> > >>>>> Jim

Reply via email to