http://savagelook.com/blog/away3d/away3dlite-normals-and-face-linking
normals and face linking in away3dlite. The face linking is not a rolled up class like FaceLink in Away3D since the modifications were minimal. I did make changes to Face.as to include a normal and center at creation time, so as long as you don't deform the mesh, everything should work. If you do deform the mesh (like with as3mod or manually) you would just need to recalculate the normal and center for each face affected. One note, katopz mentioned that you could access a face's vertices through face.mesh.vertices, but I never got around to trying that. By doing that and maintaining your own vectors of face centers and normals, you could create this face linking code without making changes to Face.as, if you were so inclined. On Jun 23, 11:37 am, savagelook <[email protected]> wrote: > Thanks for the insights katopz. > > For anyone interested I have just got face linking (on steroids) > working in lite. All credit goes to the original FaceLink author as > 98% is just copied code from there. The rest is just minor > computational changes using Vector3D in the absence of Number3D. The > code I have now requires minor changes to Face.as, but I'm going to > see if I can also do it without changing the source and maintain a > good framerate. I'll post it up once I have it all ironed out. > > On Jun 22, 3:38 am, katopz <[email protected]> wrote: > > > > > Hey guys > > > it's for speed reason, dot access is slower, so private _vertices is just > > bypass that dot and acting like referrer, you can saw bypass like this every > > where in lite libs > > > if you really want to access vertices you can use mesh.vertices and provide > > faceIndex for each face, or mesh.faces[index] > > > for normal comment out there is just under development for light somehow, > > it's not in my field btw > > > hth > > > On 22 June 2010 14:10, Michael Iv <[email protected]> wrote: > > > > I talked to Rob Bateman about this issue a few weeks ago in relation to > > > another class. He said that some properties became private in order to not > > > be exposed for a regular user .(Still don't understand a reason for > > > this).But you can still access most of these using arcane namespace. > > > > On Tue, Jun 22, 2010 at 6:56 AM, savagelook > > > <[email protected]>wrote: > > > >> While I'm still hoping for answers to my questions, I wanted to note > > >> that I uncommented the normals code in the faces in away3dlite and it > > >> works well. I also was able to use it to put basic face linking > > >> functionality into lite. I'll post it up on my blog soon if any is > > >> interested. > > > >> On Jun 21, 11:33 am, savagelook <[email protected]> wrote: > > >> > Also, why are the vertices of faces now private with no getters or > > >> > setters? Why were mapping coordinates used to calculate the normals > > >> > instead of the vertices like in Away3D 3.x? > > > >> > On Jun 21, 11:09 am, savagelook <[email protected]> wrote: > > > >> > > I would also like to know why the normals are commented out in > > >> > > away3dlite, as of the latest trunk revision (2613)? In the mean time > > >> > > I'm going to use them and see if they work as expected. > > > >> > > On May 3, 1:33 am, Michael Iv <[email protected]> wrote: > > > >> > > > You are right , I just like to keep things sorted as much as > > >> possible . > > >> > > > Actually I thought also about Vertex Vectors , but then desired to > > >> try this > > >> > > > out . > > >> > > > v1.normalize x2 IS TYPING MISTAKE :) > > >> > > > Why they commented normal? > > > >> > > > Thanks For Help > > > >> > > > On Mon, May 3, 2010 at 5:24 AM, Ken Railey <[email protected]> > > >> wrote: > > >> > > > > So using the texture coordinates is a bit of an unorthodox > > >> approach. I > > >> > > > > would take the cross product of two face edges and normalize > > >> > > > > that. > > >> Beyond > > >> > > > > that, I am not sure why to are normalizing v1 twice (or even > > >> > > > > once, > > >> just skip > > >> > > > > it). Also, that call to new Vector3D() when initializing > > >> > > > > normVect > > >> is > > >> > > > > wasted, since it gets overwritten on the next line. > > > >> > > > > Also, after a quick glance at svn it seems like the Face class > > >> > > > > had > > >> a normal > > >> > > > > at some point that is just commented out. Maybe try using that? > > > >>http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/s... > > > >> > > > > On Sun, May 2, 2010 at 4:38 PM, Michael Iv > > >> > > > > <[email protected]> > > >> wrote: > > > >> > > > >> Hi Guys , I was looking for Normal Face Vector in Lite and found > > >> none . I > > >> > > > >> tried to write my own . From my check It seems working ... But I > > >> would like > > >> > > > >> to get a confirmation from Math > > >> > > > >> experts here . > > >> > > > >> I used the tuvs to create 2 vectors on the Face plane, then did > > >> cross > > >> > > > >> product . Was that right ? > > > >> > > > >> Here is the code: > > >> > > > >> var face:Face=sp.faces[45]; > > >> > > > >> var v1:Vector3D=new > > >> Vector3D(face.t0,face.u0,face.v0); > > >> > > > >> var v2:Vector3D=new > > >> Vector3D(face.t1,face.u1,face.v1); > > >> > > > >> v1.normalize(); > > >> > > > >> v1.normalize(); > > >> > > > >> var normVect:Vector3D=new Vector3D(); > > >> > > > >> normVect=v1.crossProduct(v2); > > >> > > > >> normVect.normalize(); > > > >> > > > >> Thanks. > > > >> > > > >> -- > > >> > > > >> Michael Ivanov ,Programmer > > >> > > > >> Neurotech Solutions Ltd. > > >> > > > >> Flex|Air |3D|Unity| > > >> > > > >>www.neurotechresearch.com > > >> > > > >> Tel:054-4962254 > > >> > > > >> [email protected] > > >> > > > >> [email protected] > > > >> > > > -- > > >> > > > Michael Ivanov ,Programmer > > >> > > > Neurotech Solutions Ltd. > > >> > > > Flex|Air |3D|Unity|www.neurotechresearch.com > > >> > > > Tel:054-4962254 > > >> > > > [email protected] > > >> > > > [email protected] > > > > -- > > > Michael Ivanov ,Programmer > > > Neurotech Solutions Ltd. > > > Flex|Air |3D|Unity| > > >www.neurotechresearch.com > > >http://blog.alladvanced.net > > >http://www.meetup.com/GO3D-Games-Opensource-3D/ > > > Tel:054-4962254 > > > [email protected] > > > [email protected] > > > -- > > Regards > > ----------------------------------------------------------- > > Todsaporn Banjerdkit, katopz,http://sleepydesign.com > > Away3DLite and JigLibFlash Developer Team
