Re: Texture

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++bitch.reading.sgi.com)
Wed, 25 Oct 1995 21:37:16 +0100


The main problem is the absence of texture coordinates in the model.
You could apply texture with state Overrides or by modifying geostate
information, but the texture coordinates on all the vertices
would be the same and this coordinate would happen to be whatever was
lying around in the pipeline when the model was drawn, but don't
despair. You can generate texture coordinates automatically with vertex
info using the texgen() call, and modify the application of texture
by varying plane equations & the texture matrix.

Here are draw callbacks which do this sort of thing to a pfNode,
You can vary the plane equations or apply transformations to the
texture matrix using mmode(MTEXTURE) but be sure to undo them
afterwards.

long Texture_pre(pfTraverser *trav, void *data)
{
  float splane[] = { 1.0, 0.0, 0.0, 0.0 };
  float tplane[] = { 0.0, 1.0, 0.0, 0.0 };

  /* use TG_SPHEREMAP here if youre applying environment maps */
  /* textures in model coordinates */
  texgen(TX_S, TG_LINEAR, splane);
  texgen(TX_T, TG_LINEAR, tplane);
  texgen(TX_S, TG_ON, NULL);
  texgen(TX_T, TG_ON, NULL);
}

long Texture_post(pfTraverser *trav, void *data)
{
  texgen(TX_S, TG_OFF, NULL);
  texgen(TX_T, TG_OFF, NULL);
}

Happy texturing,

Angus.

On Oct 25, 4:27pm, Seth A Rosenblum wrote:
> Subject: Texture
> Is it possible to add texture to a multigen flight model using performer? If
> the answer is yes, I would appreciate an explanation of how this is done.
>
> Thank You,
>
> Seth A. Rosenblum
>
>-- End of excerpt from Seth A Rosenblum

-- 
Angus Dorbie,
Silicon Graphics Ltd, UK
dorbie++at++reading.sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:58 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.