|
![](/i/fill.gif) |
VDist(P1,P2) is just short (as if ;)) for vlength(P2-P1), i prefer the latter
because it saves me an #include but it doesn't really make a difference.
I *am* taking the y-component into account:
Basically I work with the rectangular triangle with vertices P1, P1+<d.x, 0,
d.z> and P1+<d.x, d.y, d.z> = P1+d = P2. (draw a picture if you need to). The
ratio of the length of the horizontal component (vlength(<d.x, 0, d.z>) = b) and
the length of the vertical component (d.y) determine the shear matrix.
The actual distance length(d) appears in the second version as a normalization
constant. In the first version it does not appear explicitly, but mathematically
it is still in there somewhere as it is well defined by the lengths b and d.y
via phytagoras.
Regards Roman
Thomas de Groot <tenDOTlnDOTretniATtoorgedDOTt> wrote:
> Thank you Roman, for your help! This works fine.
>
> One question: you use vlength() instead of VDist() and seem not to take
> into account the y-component. However, it seems to me that between P1
> and P2 the y-component can potentially be of importance especially if
> height differences are large. Would that not be compensated by VDist()?
> Or vlength(d)?
>
> Thomas
Post a reply to this message
|
![](/i/fill.gif) |