RESOLVED: Problem with a material’s light

Software: Away3D 4.x

HowlingBard, Newbie
Posted: 16 September 2011 07:27 PM   Total Posts: 20

Hello everybody!
I got a strange situation here.
I’m using Away3d V.4.
I’m loading two models with extension “.obj”: one is lowpoly and other one is highpoly. The problem is when I try to load the highpoly with a material and I attach light to this material.
This is the error being pointed:

TypeError: Error #2007: O parâmetro data não deve ser nulo.
at flash.display3D::VertexBuffer3D/uploadFromVector()
at away3d.core.base::SubGeometry/getVertexNormalBuffer()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dcorebaseSubGeometry.as:224]
at away3d.core.base::SubMesh/getVertexNormalBuffer()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dcorebaseSubMesh.as:199]
at away3d.materials.passes::DefaultScreenPass/render()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dmaterialspassesDefaultScreenPass.as:411]
at away3d.materials::MaterialBase/renderPass()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dmaterialsMaterialBase.as:348]
at away3d.core.render::DefaultRenderer/drawRenderables()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dcorerenderDefaultRenderer.as:104]
at away3d.core.render::DefaultRenderer/draw()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dcorerenderDefaultRenderer.as:48]
at away3d.core.render::RendererBase/executeRender()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dcorerenderRendererBase.as:253]
at away3d.core.render::RendererBase/render()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dcorerenderRendererBase.as:226]
at away3d.containers::View3D/render()[C:ArcadeVilleFrameworksAway3D_FP11srcaway3dcontainersView3D.as:375]
at Teste_Trigger/onEnterFrame()[C:ArcadeVillebranchesHelderProjectsComet_ShotsrcTeste_Trigger.as:435]

I don’t know why it’s happening. Anyone got a idea?

   

Avatar
Alejandro Santander, Administrator
Posted: 16 September 2011 08:07 PM   Total Posts: 414   [ # 1 ]

It seems to me that your models don’t have normals data. They come in play when you introduce lighting, so that’s why you get the error then.

You could try to alter the models in a 3D editor making sure that the obj output has normal data. If you open the obj with a text editor, vertices are listed with the form v -296.4720000000 94.4876000000 32.7512000000 and normals with the form vn 0.975440465342409 -0.210371154276363 -0.065267725722710, so if you don’t see any vn entries, then you don’t have normals indeed.

Another possibility is to ask Away3D to derive the normals for you. For this, you should find the corresponding sub geometry and try something like this:

yourMesh.geometry.subGeometries[yourSubGeomIndex].autoDeriveVertexNormals true
   

HowlingBard, Newbie
Posted: 19 September 2011 01:05 PM   Total Posts: 20   [ # 2 ]

Yeah, that’s it!
I was using a model that hasn’t got normal data.
Thanks!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X