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

Support rendering 3D trimesh, with example #51

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

jeffparsons
Copy link
Contributor

No description provided.

@jeffparsons
Copy link
Contributor Author

Here's a video of the example, demonstrating the converted tri-mesh:

trimesh3d.mp4

@jeffparsons
Copy link
Contributor Author

I implemented this to help me debug something. I created a 3D tri-mesh based wedge, like so...

   |\
x  | \
^  |  \
|  |___\
    -> y

I found that a ball rolling on it would behave strangely, like rolling down a "seam" between the two triangles that make up its top side (even though they form a perfectly smooth plane) or "sinking" into the wedge.

Similarly, if you reduce the number of ramp segments to 3 in the included example, you'll see this:

broken-ramp.mp4

I haven't gotten any further than this, but I figured having a way to visualize 3D tri-mesh and an easy way to repro the problem might be worth a PR.

@sebcrozet sebcrozet merged commit a838854 into dimforge:master Jan 23, 2021
@sebcrozet
Copy link
Member

Thank you for this PR! The problem you are experiencing here is likely caused by the common physics-engine problem called the "internal edges problem". Basically, your ball hits the edges between two triangles, and this edge contact ends up having a normal that is not parallel to the adjacent triangles faces' normals. So this deviates the ball from its trajectory since it is as if the floor isn't actually flat.

This problem is not easy to solve. It would be great to move your screenshots to a separate issue dedicated to this problem.

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

Successfully merging this pull request may close these issues.

None yet

2 participants