Alan, > Im creating meshes/models form lingo. > > I am having a bit of trouble with normals. > > Normally you set number of normals to 0 then call > generateNormals(#smooth) yeah > > Well basically I have the normal data already and want to use > that so I don't call generateNormals but I do set the normals > list and count. > > I also do model.build() > > But nothing appears on the screen! > > It works fine if I ignore my normal list and let director work it out. > > Any ideas?
I can confirm that it is possible to generate a mesh, specify your own normal list and then build that mesh without having to call generateNormals(). Look below my signature and you'll see a very simple working example where I commented out my generateNormals() call and instead set the mesh's normalList directly prior to calling build(). The one item that does seem worth confirming is whether or not you're calling build() after setting the normalList property or before as you should in fact call build() after setting this property. You do say above that you also call build() but it's not clear when in the process you do that. Cheers, Tom Higgins | Product Manager | Director & the Shockwave Player Adobe Systems Incorporated http://weblogs.macromedia.com/thiggins/ ... -- builds a simple two-sided triangle mesh on buildTriangleMesh (tWorld, tMaxDim) -- initialize the triangle's vertex positions tA = vector( (-(tMaxDim*1.5) + random(tMaxDim*3)),((tMaxDim/2.0) + random(tMaxDim/2.0)),0 ) tB = vector( -random(tMaxDim*1.5),-random(tMaxDim*1.5),0 ) tC = vector( random(tMaxDim*1.5),-random(tMaxDim*1.5),0 ) -- initialize the mesh data information tName = "triangle" tNumberOfFaces = 2 tNumberOfVertices = 3 -- create a new mesh model resource tMesh = tWorld.newMesh(tName,tNumberOfFaces,tNumberOfVertices) -- set the mesh primitive's vertext list tMesh.vertexList = [tA,tB,tC] tMesh.face[1].vertices = [1,2,3] tMesh.face[2].vertices = [3,2,1] -- generate the normals and build the mesh -- tMesh.generateNormals(#flat) tMesh.normalList = [vector( 0.0000, 0.0000, 1.0000 ), vector( 0.0000, 0.0000, -1.0000 ), vector( 0.0000, 0.0000, 0.0000 )] tMesh.build() -- return a reference to the generated mesh primitive return tMesh end buildCylinderMesh [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
