Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #1

Open
amirgeva opened this issue Feb 10, 2015 · 12 comments
Open

Update #1

amirgeva opened this issue Feb 10, 2015 · 12 comments

Comments

@amirgeva
Copy link

Hi. I'm the original author of ColDet.
Just a couple of updates: The original email address as shown in your main README has been inactive for years. You can contact me here on Github, if need be.
Also, although the library has not had an update for a very long time, it did get a version 2 back in 2013 that included multi-object systems (http://sourceforge.net/projects/coldet/)

I would suggest that you merge those updates, if you want to avoid too much of divergence.

@Luxcy
Copy link

Luxcy commented Mar 20, 2019

Hi,Sir.@amirgeva I'm learning about ColDet.But I find nothing tutorials about it.Do you have some examples codes?Thank you very much!

@HuguesDelorme
Copy link
Member

HuguesDelorme commented Mar 22, 2019

Hi @Luxcy you can first have a look at the HTML doc for CollisionModel3D :
http://www.fougue.pro/docs/claudette/0.1/class_claudette_1_1_collision_model3_d.html#details

Create a model, then add the triangles of your mesh with addTriangle() and call finalize() when done.
To test collision create an object for the relevant test (ray, sphere or another model), for example :

Claudette::CollisionModel3D model;
foreach triangle in mesh {
    model.addTriangle(...);
}
model.finalize();
Claudette::RayCollisionTest rayTest;
rayTest.setRayOrigin(...);
rayTest.setRayDirection(...);
rayTest.setRaySearch(RayCollisionTest::SearchClosestTriangle);
if (model.rayCollision(&rayTest)) { // Ray-Model collision ?
    const float* pntCollision = rayTest.point();
    // ...
}

Notice that you can run many concurrent collision tests on the same model. This is an enhancement allowed by Claudette but not by ColDet.
Feel free to ask more help here if you are blocked.

@Luxcy
Copy link

Luxcy commented Mar 23, 2019

@HuguesDelorme Thank you very much!
I try a rayCollision function,and there are things I can't understand.
First,I create the model, and add the triangles of my mesh of teeth.
Second,I set the position of camera ,and use rayCollision to test each point of my mesh if it can be seen at the position of camera.I can't see some points, but these points can be seen at the position.
Just like.
I see like the follow picture A at the position of camera.
screen_short12
The mesh like the follow picture B at the position of camera.
10
There are some yellow points in the picture B that I think they should been seen.But the rayCollision of these points return false in fact.
Beside,I set segmin equals 0.0001 ,segmax is default value, origin is the position of the point,direction is a normal ray from the point to camera and closet is false in the rayCollision(const float origin[3], const float direction[3],bool closest,float segmin, float segmax)
I hope I say my problem clearly and look forward to your guidance.

@HuguesDelorme
Copy link
Member

Hello @Luxcy

I don't clearly understand your intent. You said you are doing ray collision from a mesh point to the camera but obviously this won't collide right ? How could such ray intersects ?

@Luxcy
Copy link

Luxcy commented Mar 25, 2019

Thank you for your reply. @HuguesDelorme
I said I am doing ray collision about a ray from a mesh point to the camera that a ray will collide the mesh,but the function rayCollision return false.Just like There are two same cubes named A and B.A is behind B at the position of camera.Besides, A and B are collinear. We can't see A,but a ray from A to the camera won't collide with B.
At fact, the vertex of the ray is not the point on the mesh, but moves segmin forward along the direction of the ray to avoid the point collide with the face above the point.

@Luxcy
Copy link

Luxcy commented Mar 25, 2019

I found a error at what my said before.
1032308692

@HuguesDelorme
Copy link
Member

But your camera isn't a physical object right ? If so then how could your ray test collide with it ?
You have set up a collision model from a mesh. Then a ray collision test is just about checking if some ray intersects with your mesh(ie the collision model).

@Luxcy
Copy link

Luxcy commented Mar 25, 2019

Yes, my camera isn't a physical object.
Exactly,I use a ray collision test is about checking if some ray intersects with my mesh.
When the ray is from a point of my mesh,if it intersects with my mesh means the point can't been seen, or means the point can been seen.
There are points that can't been seen but rayCollision function told me that the rays from these point don't intersect with my mesh.

@HuguesDelorme
Copy link
Member

HuguesDelorme commented Mar 27, 2019

@Luxcy
What I don't understand is why you set the ray origin to a point of your mesh ? Actually I don't see what you are wanting to do.

@Luxcy
Copy link

Luxcy commented Mar 28, 2019

Sorry,I forget to say my goal.
I want to use collision to know whether the test point is visible at a specific angle of view.

@amirgeva
Copy link
Author

amirgeva commented Mar 28, 2019 via email

@Luxcy
Copy link

Luxcy commented Apr 1, 2019

Yes,I do like you said.
Use the function rayCollision(__pt,__ray, false, __segmin, __len) to test.
I ran into a problem, maybe a bug. Some points were invisible, but no collision occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants