Login
Username:

Password:


Lost Password?

Register now!
Main Menu
H3D.org Feeds
H3D.org Forum Index
   Programming Issues
     lineIntersect function
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
RaoDaoZao
Posted on: 2010/1/4 18:47
Just popping in
Joined: 2009/12/6
From: Glasgow
Posts: 4
lineIntersect function
I have a scene containing the following collision node:

<Collision enabled="true" DEF="GEOMETRY">
<Shape>
<Appearance>
<Material DEF="MATERIAL" />
<FrictionalSurface dynamicFriction="0.6" staticFriction="0.2"/>
</Appearance>
<Sphere radius="0.1" />
</Shape>
</Collision>

I access the collision Node by its def, then call the lineIntersect function on it. As far as I am aware from the documentation, this function should return true if the given line intersects any piece of geometry.

However, I am unable to get it to return "true" even when drawing a line that definitely intersects my sphere -- I can only seem to get a positive response for it intersecting the viewpoint node that is the camera.

All I am interested in is whether or not an intersection has occurred, not any further information.

Am I doing something wrong, or am I missing something?
Markus
Posted on: 2010/1/8 10:54
Webmaster
Joined: 2006/3/27
From: SenseGraphics
Posts: 1532
Re: lineIntersect function
Did you use a debugger to step through the code to know where it returns false? If it does so at the X3DGeometryNode::lineIntersect and in that case why?

You have understood the documentation correct, it should return true if it intersect any kind of geometry.
RaoDaoZao
Posted on: 2010/1/8 15:06
Just popping in
Joined: 2009/12/6
From: Glasgow
Posts: 4
Re: lineIntersect function
Gosh, I'm so sorry, I've just discovered a really glaring, stupid mistake.

It turns out I was leaving my start and end line points behind at the starting point instead of making them relative to the current position!

Really sorry to have bothered you.
Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 



(C) 2004 SenseGraphics AB    ---    Powered by XOOPS