Frustum clipping error:1009

9 views
Skip to first unread message

GBear

unread,
Nov 3, 2009, 9:48:32 AM11/3/09
to away3d.dev
Hi Guys

My scene works fine until I apply Frustum clipping then i get
error1009 a mile long.

I have 2 .obj and 8 textfield3D in an ObjectContainer3D

Any help appreciated thanks in advance.

function initEngine():void
{
scene = new Scene3D();

clipping = new FrustumClipping();
clipping.minZ = 10;

camera = new HoverCamera3D({zoom:2, focus:300, distance:1000});

camera.panangle = 0;
camera.tiltangle = 0;
camera.targetpanangle = camera.panangle = 180;
camera.targettiltangle = camera.tiltangle = 0;
camera.mintiltangle = -90;


view = new View3D({renderer:Renderer.INTERSECTING_OBJECTS});
view.scene = scene;
view.camera = camera;
view.clipping = clipping;
}

some of the error list:

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at away3d.core.base::VertexClassification/getDistance()
at away3d.core.clip::FrustumClipping/checkNormalFace()
at away3d.core.clip::FrustumClipping/checkElements()
at away3d.core.project::MeshProjector/primitives()
at away3d.core.traverse::PrimitiveTraverser/apply()
at away3d.core.base::Object3D/traverse()
at away3d.containers::ObjectContainer3D/traverse()
at away3d.containers::ObjectContainer3D/traverse()
at away3d.containers::View3D/render()
at seecoscene2_fla::MainTimeline/onEnterFrame()
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at away3d.core.base::VertexClassification/getDistance()
at away3d.core.clip::FrustumClipping/checkNormalFace()
at away3d.core.clip::FrustumClipping/checkElements()
at away3d.core.project::MeshProjector/primitives()
at away3d.core.traverse::PrimitiveTraverser/apply()
at away3d.core.base::Object3D/traverse()
at away3d.containers::ObjectContainer3D/traverse()
at away3d.containers::ObjectContainer3D/traverse()
at away3d.containers::View3D/render()
at seecoscene2_fla::MainTimeline/onEnterFrame()

Peter Kapelyan

unread,
Nov 3, 2009, 9:55:34 AM11/3/09
to away3...@googlegroups.com
What if you omit this line?


view = new View3D({renderer:Renderer.INTERSECTING_OBJECTS});

and just use view=new View3D();

Just trying to pinpoint the problem.

-Pete

--
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

GBear

unread,
Nov 3, 2009, 6:58:13 PM11/3/09
to away3d.dev
Hi Pete

It was doing it before adding that line and I need it to prevent
triangles disappearing. My .obj are quite irregular and close to each
other.


Thanks for the quick reply.

Cheers

GBear

unread,
Nov 3, 2009, 7:02:37 PM11/3/09
to away3d.dev
I just decided to count it and there are 87 error 1009's!



On Nov 3, 10:55 pm, Peter Kapelyan <flashn...@gmail.com> wrote:

Peter Kapelyan

unread,
Nov 3, 2009, 7:52:51 PM11/3/09
to away3...@googlegroups.com
Hmm. Sorry bout that :O To tell the truth, I've seen a bunch of errors, and this may be the first time I've seen this one!

The last time someone had something remotely close to this error, I suggested to move everything in the scene and it worked for them (no more errors). I don't know if it's the same case but can you try this:

Say all your objects are spread out around 0,0,0 , some going to -1000 x etc. Try moving all your objects into some other area, for instance everything is in the positive X, Y and Z (no negative values). If that doesn't work, try some other area, like everything is negative Z, but positive X etc.

Hopefully it works, keeping my fingers crossed!

-Pete

GBear

unread,
Nov 3, 2009, 9:46:17 PM11/3/09
to away3d.dev
Thanks Pete I'm now stuck at work and will give that a try later.

It could well be something like this because I do have a mix of
positive and neg values on all axes.

If it doesn't work I'll post my code. I'm still really new to this and
trying to learn five new programmes and maybe I've just done something
else stupid.

Later!
> HTTP://AWAY3D.COM- Hide quoted text -
>
> - Show quoted text -

GBear

unread,
Nov 4, 2009, 7:42:48 AM11/4/09
to away3d.dev
ok, thanks Pete, looks like I've got most of it.

I've changed a lot, but it looks like it was the camera position too
close was the first issue, followed by the model size.

I first changed all Z co ords to positive which showed scene as
normal, but it still disappeared completely depending on movement,
even without touching the edges of view.

Changing all X and Y co ords to positive too opened blank swf scene
but then realised it was there but could only be seen at certain
angles.

Changing the camera position from 1000 to 3000 showed the scene
properly, so I then doubled .obj model scales, even though it was
already 12 times the export from Blender.

I've now tripled size and while clipping appears to work to a point,
the scene does disappear completely at some angles.

I will fiddle some more, and reconfirm if I see anything else but to
sum up i think the camera was too close to the scene for the clipping,
even though the models were fine for normal viewing.

GBear

unread,
Nov 5, 2009, 7:30:09 AM11/5/09
to away3d.dev
I used these settings you recommended in a post last month and now it
works just fine. I haven't undone all the size and position changes
but I think this was the main problem:

view.clipping = new RectangleClipping({minX:-(600/2), minY:-(400/2),
maxX:600/2, maxY:400/2});

Thanks again!

Peter Kapelyan

unread,
Nov 5, 2009, 8:59:52 AM11/5/09
to away3...@googlegroups.com
Wow, nice! I will keep that in mind, it seems like a bug.

Thanks for the update and good luck!

-Peter
Reply all
Reply to author
Forward
0 new messages