Talal Nehme (talal++at++pdq.net)
Wed, 7 Apr 1999 09:55:54 -0500
>===== Original Message From Simon Mills <simon++at++wgs.estec.esa.nl> =====
>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
>________________________________________________________________________
This archive was generated by hypermail 2.0b2 on Wed Apr 07 1999 - 07:56:00 PDT