Having some trouble implementing D3DXComputeNormals... any hints/advice?

Henri Verbeet hverbeet at gmail.com
Mon Jul 12 18:31:57 CDT 2010

On 13 July 2010 01:11, Misha Koshelev <misha680 at gmail.com> wrote:
> I love your polite way of saying RTFM ;)
While it only rarely hurts to read the docs carefully, that wasn't my
intention here. I really only noticed that bit myself after you
mentioned D3DXTANGENT_WEIGHT_BY_AREA. What isn't entirely clear to me
from reading the documentation is if it will weight by both area and
opening angle if you pass D3DXTANGENT_WEIGHT_BY_AREA, or just by area.

> One minor note about the patch - the compute_normal function is adapted
> from a book, which I have credited in a comment
> /*
>  * Adapted from pg. 246, Frank D Luna, "Introduction to 3D Game
> Programming with Direct X 9.0c:
>  * A Shader Approach (Wordware Game and Graphics Library) [Paperback],"
> 2006.
>  */
> The function differs from the book in the:
> * name
> * parameters all on one line rather than separate lines (minor)
> * use of D3DXVec3Subtract rather than operator- (only available in C++ I
> believe)
> * name of output parameter is normal vs out
> I believe this should be okay for inclusion of this function. Plus it is
> quite basic. However, if this is not ok let me know (I honestly can't
> imagine such a case though...)
Should be ok. Computing a normal vector by taking the cross product of
two other vectors is pretty much basic vector math anyway.

More information about the wine-devel mailing list