truncated cone

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Nablabla
Posts: 14
Joined: Wed Mar 18, 2015 12:36 am

truncated cone

Post by Nablabla »

Hi,
can anybody help me, how to construct a truncated cone shape?
Image
My idea is to use a CylinderShape inside of a TransformableShape.
So when I 'distort' a cylinder by shinking its top, it becomes like a truncated cone (and I figure this way I can create many cool convex shapes).
I know that its possible, since the camera projection matrix does something similar (a kind of not affine transformation).
But the TransformableShape takes a 3x3 matrix.
So hmm, and then which matrix cell do I need to set?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: truncated cone

Post by Norbo »

The TransformableShape only supports the nontranslational affine subset of transforms. You can, however, use a WrappedShape built from a couple of thin CylinderShapes to make a truncated cone and many other shapes that can't be expressed by any transform.
Nablabla
Posts: 14
Joined: Wed Mar 18, 2015 12:36 am

Re: truncated cone

Post by Nablabla »

oh, okay then.

But the wrapped shape does compute the convex hull points, and uses them? Which means the parts are not perfectly round then? Like when I use a CylinderShape, the surface on the cylinder is smoothly round,
and the wrapped shape is not, right?

What I now do, is just create a ConvexHullShape using my graphical representations vertices for all my convex objects.
I guess the two methods have the same effect (in my version the number of samples matches the graphical representation), right?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: truncated cone

Post by Norbo »

The WrappedShape directly uses the implicit shapes. So, if you built a truncated cone out of two thin cylinders, it would be perfectly rounded around the edges- just like the cylinders are.

You can think of ConvexHullShapes as WrappedShapes over a bunch of individual "PointShapes". Unlike the ConvexHullShape, the WrappedShape can choose any shapes for its constituents.
Post Reply