OBJ’s material bug when I add any light.

Software: Away3D 4.x

2smacks, Newbie
Posted: 08 October 2011 01:24 PM   Total Posts: 9

Hello Away3d members,

I loaded an obj file and I displayed it succefully in my scene.
The problem is, when I add any type of light in my material.lights
array, flashdevelop return me this :

TypeError: Error #2007: Le paramètre data ne doit pas être nul.
      at flash.display3D::VertexBuffer3D/uploadFromVector()
      at away3d.core.base::SubGeometry/getVertexNormalBuffer()[D:2smacks
away3D2srcaway3dcorebaseSubGeometry.as:274]
      at away3d.core.base::SubMesh/getVertexNormalBuffer()[D:2smacks
away3D2srcaway3dcorebaseSubMesh.as:199]

Lights works fine with primitives likes Cube, Plane, etc… But in this case, I always get en error.

My light & my mesh are both child of my scene3D.

Can you help me, please ?

(full code in attachment)

 

   

Richard Olsson, Administrator
Posted: 08 October 2011 10:36 PM   Total Posts: 1192   [ # 1 ]

Sounds like your mesh is missing vertex normals. Try setting autoDeriveVertexNormals on the sub-geometries, or re-export your model with vertex normals.

   

2smacks, Newbie
Posted: 09 October 2011 01:07 PM   Total Posts: 9   [ # 2 ]

It Worked.

Thank you.

I love you.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X