Notifications
Clear all

[Closed] Convex Hull Script

Me? He’s showing how he just made a convex hull script in their game they are making, using point clouds.

1 Reply
(@johnwhile)
Joined: 11 months ago

Posts: 0

But i perfect know that is a convex hull , i need to implement it into maxscript (i must do it as first steep to find the alignments between two similar mesh )

Sorry, I was just posting to show his method, and thought it was interesting.

I think someone mentioned using raycasts, but if you did that for all verts or edges or whatever in a mesh, it would be very slow I think.

if you got Max 2011/2012 and MassFX or Nvidia’s PhysX tools installed, you can use the PhysX internal convex hull function . I did not test this but i guess it would work pretty fast and stable:

those are the relevant functions of physx’s maxscript interface ( nvpx )


<mesh>CreateConvexHull <mesh>mesh <integer>vertlimit <float>inflation
<mesh>CreateConvexFromPoints <&float array>points <integer>vertlimit <float>inflation
       points is In and Out parameter

UPDATE:
Just tested it on a teapot and it works great !


convertToMesh $
cvxHull=nvpx.CreateConvexHull $.mesh 300 0.5
$.mesh=cvxHull

The above code swaps the current selected object’s mesh with the corresponding convex hull, using the passed parameters ( 300 is the vertex limit, 0.5 the inflation level)

good but work for all version of max ? when i white my tool i need a “large” compatibility , from max9 to max 2012… and the problem of plugins is they must be compiled for each version…

I try to download it but isn’t free for private…

I think i will try to compile the Ccode found into www.qhull.org

I used Nvidia’s PhysX convex tool on MAX 2009.
It works very fast and stable.

2 Replies
(@johnwhile)
Joined: 11 months ago

Posts: 0

I tried to download from nvidea page but i don’t undestand, i’m not a “developer” so i can’t download it… is free ?
I tried to download it from a torrent but don’t work…

from Autodesk 3ds Max 2011 SDK\maxsdk\howto\maxscript\intervalarray i compiled this example: “intervalarray.dlx” and put it into plugin folder and MIRACLE , it work !
http://dl.dropbox.com/u/47659776/scambio/intervalarray.rar

work on max 2011 32 bit, now i try 64bit and max 9

So now i will able to add the Qhull.c source code find ( http://www.qhull.org/)
for a simple qhull.DLX

(@dokdan85)
Joined: 11 months ago

Posts: 0

You have to register on their site and then you can download it for free.

Nice, didn’t know that existed

Page 2 / 2