|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> Will work on adding the end cap intersections and surface normals.
Update:
Surface normals got implemented first.
axis-aligned development cylinder worked fine, but when tilted, the normals were
wrong, prompting my vector cross-product question in another thread.
That was the result of using R instead of r, and so once everything gets to the
point of "working", I'll likely do more testing, and then refactor to use more
descriptive identifiers.
1. I found an equation for a general cylinder, however the radius wasn't correct
when I rendered it as an isosurface. (*)
I need to track down the source of that error and document it, because that
would be useful.
As far as I am aware, we only have bounding boxes and spheres for isosurface
shapes. Odd that we don't have bounding cylinders.
I also verified that we cannot transform that bounding box using something like
the point_at or reorient_trans macros.
2. The vector-based method that I'm using will allow cylinder end caps in any
orientation. This would likely allow a great saving in computation to make such
shapes, since we wouldn't have to do CSG and add a whole other layer of bounding
and intersection.
A proposed syntax for such a shape might be something like
cylinder {Start, End, Radius, optional StartNormal, optional EndNormal}
That way if no normals are supplied, then it's just the usual right-angle
cylinder.
There may better ways that make implementation easier.
- BE
After I get that all sorted out, then I can hopefully start on properly bounding
the Catmull-Rom spline to fix the blank-out bug.
(*)
searching again for such an equation (surprisingly hard to find) yields:
\((v_{y}(z-z_{0})-v_{z}(y-y_{0}))^{2}+(v_{z}(x-x_{0})-v_{x}(z-z_{0}))^{2}+(v_{x}(y-y_{0})-v_{y}(x-x_{0}))^{2}=(v_{x}^{2
}+v_{y}^{2}+v_{z}^{2})r^{2}\)
Which looks like it may have the corrective factor included as a coefficient of
r^2
also:
https://math.stackexchange.com/questions/1184038/what-is-the-equation-of-a-general-circle-in-3-d-space
Post a reply to this message
|
 |