|
![](/i/fill.gif) |
Ron Parker wrote:
> Sorry, no, that's not what it does. It calculates the normal at each
> corner, then linearly interpolates between corners. There is no
> "plane normal." The normal vector varies continuously across the
> surface of the object. Whatever you're seeing, it's not due to
> normals.
Ah, I see. Of course, that's similar to what I thought it was doing
anyway.
At any rate, a "smooth <value>" keyword could be used to change from
linear interpolation to a non-linear value. It could be applied as an
exponent, for example, with 1.0 being the linear default. A higher
exponent would mean more smoothing.
For example, if the current routine interpolates between vectors based
on d and 1-d, the distance from each corner, then d^2 and (1-d)^2 would
tend to cause a lot more biasing toward the edges.
A simple interpolation (obviously not what the triangles use, but just
an example) might look like this:
(v1*d + v2*(1-d))/(d+(1-d))
If an exponent was added, it could be like this:
(v1*d^2 + v2*(1-d)^2)/(d^2+(1-d)^2)
Thus the weights in the average change in a non-linear fashion.
Lummox JR
Post a reply to this message
|
![](/i/fill.gif) |