Re: changing geometry property

New Message Reply Date view Thread view Subject view Author view

From: GAUVIN Yves (yves.gauvin++at++sncf.fr)
Date: 07/11/2000 01:43:29


Hi, here is an example to show you how you can change the properties of a
pre-loaded object. My example is for the ENLIGHTING state but it's the
same for the others states (see the pfGStateMode man page).

In my example, this is a simple case where my node has only one pfgeode. In
a general case you must write a function to find the pfgeode.

void
change_3D_model_property (char *p_node_name)
{
  pfNode *l_node;
  pfGeoState *l_gstate;
  pfGeoSet *l_gset;
  pfGeode *l_geode;

  l_node = pfLookupNode(p_node_name, pfGetNodeClassType()); /*get the
node*/

  l_geode = pfGetChild (l_node ,0); /*in my case it's simple, only one
pfgeode which is child of pfnode, in your case write a function to get all
pfgeode of the node*/
  l_gset = pfGetGSet (l_geode, 0); /* get the gset*/
  l_gstate = pfGetGSetGState (l_gset); /* get the gstate of the gset*/

  pfGStateMode (l_gstate, PFSTATE_ENLIGHTING, PF_OFF); /*change the
gstate*/
}

Hope it can help you,
Cheers,

Yves GAUVIN
french Railroads

Satheesh Ganapathi Subramanian a écrit :

> Hi Performers,
>
> I have a question regarding changing pfGeoState. Suppose I load a
> 3D model (.obj or .iv) using pfdLoadFile into a pfNode *node. Is there a
> way I can change the geometry state? For example, suppose the model is
> not textured and I would like to load the model without the texture and
> then change then enable texturing or texture coordinate generation, is
> there a way to do that?
>
> Thanks
> Satheesh
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jul 11 2000 - 01:47:07 PDT

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