• Splitting a concave mesh into convex shapes automatically?
    5 replies, posted
Hello, I have searched everywhere for this issue and I have found no solution. I need this mesh to be split into convex shapes automatically, so that its collision model can be compiled into Source (which only allows convex shapes) https://files.facepunch.com/forum/upload/111014/54b0d9db-490a-4e3b-9833-8e4fdc645428/1.png Here is approxmiately how I need it to be cut, note that there is height variation as well, this is only an example of what it roughly should be like from the top: https://files.facepunch.com/forum/upload/111014/0375da5b-aa40-4a57-a19c-046e314589f0/2.png Seems easy right to do it manually maybe? Nope. Not at all. Especially that there is a ton of height variation which is very difficult to see. And I need to do this for 30 meshes. So simply put, how can I generate a bunch of convex shapes from 1 concave mesh like that automatically? I need this done in the least amount of pieces possible as well.
Wth. This map model and automatically? I'd say 'Nope'. I could probably do it manually, but i dunno how to teachcode the machine todo that. Ugh.
This just can't be done manually, the "cube" method (split entire mesh at each new horizontal and vertical position of vertex) will create way too many convex pieces. This example mesh I used is simple compared to others, the others are absolute hell I need the triangles to be perfectly the same shape, so I cant be lazy with this
This is one of Source's limitations, as far as I know, there is no easy way of creating a collision model with that many pieces, without hitting some sort of limit, crashing the tools, crashing hammer, or the game. If the model has few enough pieces, you could extrude every single polygon into a convex shape, export as DMX, then use that as the collision model.
This was discussed on Discord but I'll just say it here: The amount of pieces isnt actually an issue, I can simply split the models into multiple seperate ones. I just need something that can automatically split a concave mesh into convex pieces
You can't do it automatically, but if you have 3ds max, it's pretty easy to make a collision model. I'm going to use this mesh as an example https://i.imgur.com/920dqk2.png First thing you want to do is to break it into quads by deleting the middle slice. (it's okay to still have triangles if you so desire. https://i.imgur.com/t4r3ROr.png If you want to optimize it further, you can delete edge loops as well. https://i.imgur.com/l6DLJra.png Next, select all edges and hit "split" https://i.imgur.com/Fn8pOy3.png Then go to the "translate" tool and shift + drag downward. https://i.imgur.com/hVncB06.png Next, go to border tool, and select all borders, then hit "cap" https://i.imgur.com/WPbMQ9A.png Finally, go to face mode, select all faces, then set their smoothing groups to smoothing group 1 https://i.imgur.com/IWyyIMI.png Make sure all faces use the same material id as well as the same material. Annnnnd bam https://i.imgur.com/UlQ4VqY.png Here's my qc if you want $modelname "test/example.mdl" $model Autogen "example.smd" $cdmaterials "test" $sequence idle "example.smd" fps 1 $collisionmodel "example_phys" { $concave $maxconvexpieces 128 }
Sorry, you need to Log In to post a reply to this thread.