Re: pfSwitchVal problems

New Message Reply Date view Thread view Subject view Author view

Simon Mills (simon++at++wgs.estec.esa.nl)
Wed, 07 Apr 1999 16:44:38 +0200


Talal Nehme wrote:
>
> Hi,
> I am fairly new to Performer, I couldn't set the values of any switches in
> my scene, so I tried an example from the manual to make sure the error was
> not in my code, and it still didn't work, I'm trying to fidn out what I am
> doing wrong, any help is appreciated
>
> //
> float sCurrVal;
> int result;
> pfSwitch *sample_sw;
> pfSequence *explosion1_seq, *explosion2_seq;
>
> sample_sw = pfNewSwitch();
> explosion1_seq = pfNewSeq();
> explosion2_seq = pfNewSeq();
>
> pfAddChild(sample_sw, explosion1_seq);
> pfAddChild(sample_sw, explosion2_seq);
>
> result = pfGetNumChildren(sample_sw);
> fprintf(stderr,"switch has %d children\n",result);
>
> sCurrVal = pfGetSwitchVal(sample_sw);
> fprintf(stderr,"switchval = %f\n",sCurrVal);
>
> pfSwitchVal(sample_sw, 1); //set to 1
> sCurrVal = pfGetSwitchVal(sample_sw);
> fprintf(stderr,"switchval = %f\n",sCurrVal);
> //
> The output I get is:
> switch has 2 children
> switchval = 0.000000
> switchval = 0.000000

pfGetSwitchVal returns an *integer*, not a float. This is probably why
the print statement is showing zero and maybe why your application is
not working.

>
> Talal++at++pdq.net
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
Regards, Simon
________________________________________________________________________

Simon C. Mills Modelling & Simulation Section (TOS-EMM) Tel: +31 (0)71 565 3725 European Space Agency (ESA/ESTEC) Fax: +31 (0)71 565 5419 Postbus 299, 2200AG Noordwijk e-mail: simon++at++wgs.estec.esa.nl The Netherlands http://www.estec.esa.nl/wmwww/EMM ________________________________________________________________________


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Apr 07 1999 - 07:45:28 PDT

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