[info-performer] pfCompare

New Message Reply Date view Thread view Subject view Author view

From: Goncalo Carvalho (G.Carvalho++at++staff.gsa.ac.uk)
Date: 09/12/2002 02:04:12


Hey,

Why does the program below prints MTL2 equal to MTL1. Shouldn't this
materials be considered different?

Thank you for your attention,

Goncalo

#include <Performer/pf.h>
#include <Performer/pr/pfMaterial.h>

int main( )
{
        pfInit( );
        pfMultiprocess( PFMP_DEFAULT );

        pfConfig( );

        pfMaterial* mtl1 = new pfMaterial;
        mtl1->setColor( PFMTL_AMBIENT, 0.0f, 0.0f, 0.0f );
        mtl1->setColor( PFMTL_DIFFUSE, 0.0f, 0.0f, 0.0f );
        mtl1->setColor( PFMTL_SPECULAR, 0.0f, 0.0f, 0.0f );
        mtl1->setShininess( 0.0f );
        mtl1->setAlpha( 0.0f );

        pfMaterial* mtl2 = new pfMaterial;
        mtl2->setColor( PFMTL_AMBIENT, 1.0f, 1.0f, 1.0f );
        mtl2->setColor( PFMTL_DIFFUSE, 1.0f, 1.0f, 1.0f );
        mtl2->setColor( PFMTL_SPECULAR, 0.0f, 0.0f, 0.0f );
        mtl2->setShininess( 0.0f );
        mtl2->setAlpha( 0.0f );
        
        if( !mtl2->compare( mtl1 ) )
                pfNotify( PFNFY_NOTICE, PFNFY_PRINT, "MTL1 equal to MTL2" );
        else
                pfNotify( PFNFY_NOTICE, PFNFY_PRINT, "MTL1 different of MTL2" );

        pfExit( );
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Sep 12 2002 - 02:09:02 PDT

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