Re: texture matrix
AnitaKishore (kishore++at++electrogig.com)
Mon, 4 Mar 1996 09:19:46 -0800
On Mar 2, 2:59pm, Angus Dorbie wrote:
> Subject: Re: texture matrix
> Bummer! (I should have known better)
>
> Here are some draw callbacks which worked with performer 1.2, I haven't
> tried it with 2.0 but it should work. I think this is pretty much what you
> described you were doing though.
>
> static float ident_matrix[4][4] = {
> 1.0, 0.0, 0.0, 0.0,
> 0.0, 1.0, 0.0, 0.0,
> 0.0, 0.0, 1.0, 0.0,
> 0.0, 0.0, 0.0, 1.0
> };
>
> static long Pre_texture_transform(pfTraverser *trav, void *data)
> {
> short MAT_mode;
> MAT_mode = getmmode();
> mmode(MTEXTURE);
> loadmatrix(texture_matrix); /* do what you like here */
> mmode(MAT_mode);
> }
>
> static long Post_texture_transform(pfTraverser *trav, void *data)
> {
> short MAT_mode;
> MAT_mode = getmmode();
> mmode(MTEXTURE);
> loadmatrix(ident_matrix);
> mmode(MAT_mode);
> }
>
> Rgds,
> Angus.
>
Yup, actually this method of resetting the matrix stack with the id matrix
is correct and works. My problem was occuring because the .iv file had
not been made properly. It had some static textures (same as the ones I
wanted to translate) in the nodes at the very top which was being inherited
as static textures and hence overdrawing the translation that I did.
Something to do with zbuffering I guess.
Though this file works perfectly with Inventor renderor and engines. So I
didn't think that the file could be incorrect.
Thanks for all your help.
-anita
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:52:31 PDT