Chamfer cylinders vs cones

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Chamfer cylinders vs cones

Postby matibee » Mon Dec 26, 2011 1:42 pm

What's the difference between the two collision types? From the source they both have just a radius and a height.
Scratch that request. I remember now :?

I was looking for a tapered cylinder or truncated cone primitive (base radius, top radius and height).

Any suggestions?

Thanks

PS. Just passing through NGD again like I tend to once every few years, like a wandering comet :)
matibee
 
Posts: 7
Joined: Thu Aug 05, 2004 2:15 pm

Re: Chamfer cylinders vs cones

Postby Julio Jerez » Mon Dec 26, 2011 2:04 pm

I though of adding a perpective scale shape modofier, however that is something that very few people has a need for.
It is not practical do it just because I can, if maybe one person in hundreds will actually use that kind of funtionality, specially when teh shape can be approximated witha convex HULL.

would a procedural function that sample points from the shape and submit then to a convex hull do it?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Chamfer cylinders vs cones

Postby matibee » Mon Dec 26, 2011 2:27 pm

I appreciate it can be done with a convex hull but I was looking for the performance and accuracy obtained from using collision primitives only.

Thanks for a swift reply Julio! Happy new year and best wishes to the NGD team and it's users.
matibee
 
Posts: 7
Joined: Thu Aug 05, 2004 2:15 pm

Re: Chamfer cylinders vs cones

Postby Julio Jerez » Mon Dec 26, 2011 2:46 pm

The perpertive shape modifre will have any perpertice trabnform mation but is a complex task.

however if you realy nee that shape, it can be special case very eassyly.
Sicne teh ebngien is open source anyone can add new shapes.
it will be a good exerside for you.

here is hwo I would go about.


copy the cone class, in the new class save the to radius. and add the two radius

then oveload tow function: CalculatePlaneIntersection and SupportVertex
both should be almost idetical to teh cone function.

if you look at the code CalculatePlaneIntersection , you will see that the contact are calculted by rotation teh cillutte of the shape to aligned with the collision plane.
the cross section silluette of a cone is triangle, the cross section of your shape will be a regular trapezoid.
basically the trick to make surface of revulution collision, is how to find the cilluette of two class section of the shape, and that is all.

as you can see 3d collision is not really 3d, it is actually 2d, is just that in each case the 2d space changes.
That will give you a perfect smoot collision, which is what close form shape provide.

It will be also faster since clipping and support vertex can are also close form function with contact time time complexity. while a convex hull will need to have many points,
and tha will make slower.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Chamfer cylinders vs cones

Postby matibee » Mon Dec 26, 2011 3:04 pm

:) Very interesting. I've been looking for open source solutions that either include this primitive shape or look simple enough for a hacker like me to add.

FYI this is the project I'm playing with...

http://www.matibee.co.uk/wpsite/2010/01/

I must state that the demo above was not made using Newton! I am simply looking at some options during my holidays :)

I've already tried using convex hulls to describe the cutter geometry and due to the brute force penetration tests and required accuracy my program performs quite badly. Switching to primitives has made a big difference but my current solution supports only plain spheres.

Newtons Spheres, cylinders, cones and tapered cylinders are perfect. A truncated cone would be the the icing on the cake.

How does it make you feel about Newton being applied in this way?
matibee
 
Posts: 7
Joined: Thu Aug 05, 2004 2:15 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest