Thanks Wes! I will try.
And thanks for pointing out those functions! I didn't know about them!
Aditya
On Tue, Apr 14, 2009 at 3:50 PM, Wes Bethel <ewbethel09@...> wrote:
>
>
> R. Aditya Kadambi wrote:
>
>> Hi;
>>
>> The guide says that you can specify only pervertex normals for
>> RM_INDEXED_TRIANGLES. I am trying to configure normals at the vertices using
>> the usual cross product approach:
>>
>> So, if a triangle has vertices V0, V1 and V2: To compute normal at V0. I
>> use vectors (V1  V0) and (V2  V0). I do it similarly for the other two
>> vertices.
>>
>> Is my approach correct? The guide doesn't have examples on setting normals
>> for RM_INDEXED_TRIANGLES.
>>
>>
> Hi,
>
> Assuming you don't have normals and must compute them (isocontouring
> routines, for example generate pervertex normals as part of their
> computation), then the crossproduct approach would work fine. You might
> find these routines helpful: rmVertex3DDiff(), rmVertex3DCross() and
> rmVertex3DNormalize().
>
> You will set the normals like you do for any other primitive, see
> rmPrimitiveSetNormal3D(). There, you will want the number and order of
> normals to be the same as the number and order of vertices. RM will assume
> that normal[i] is associated with vertex[i], where i is taken from index[i],
> set by rmPrimitiveSetIndices().
>
> HTH,
> wes
>
>
>
