ScriptSpot home

MCG

MCG – InVolume

By dgsantana · 2015-05-13

Community reviewsNo reviews yet.
Version
1.0
Version requirement
2016
Date updated
2015-05-04
Legacy votes
2
External download
External download
Report a problem
Description

So, ever wanted to write your own Volume Select modifier. Well, we are sharing a set of compounds with a sample modifier for that purpose :).

So we have taken two approaches to the problem: a “dummy” approach, and a mathematical correct one.

The first one, the “dummy” one, just shoots rays (6 in total) and waits to see if all return report a hit. If all report a hit, it assumes its inside something (sometimes we could be outside :P, I will explain in a bit). This can fail in geometry that is shelled, since it doesn’t take in account the angle between hit normal and the ray direction, and hollow part will report as an inside hit.
The second approach uses only one ray, and does compute the angle between the hit normal vector and the ray direction vector (above 90º we assume its an inside hit), but assumes that the object is closed and watertight, so if a mesh is open, this can have weird results.
So, choose whatever is more suited to the job, both are fast.

Videos

More by dgsantana

View all contributions
Comments (0)