Re: Setting colour of lines to full white

New Message Reply Date view Thread view Subject view Author view

From: Simon C Mills (simon++at++wgs.estec.esa.nl)
Date: 11/10/2000 00:14:23


Roy Ruddle wrote:
>
> Hi there,
>
> I'm trying to set the colour of some PFGS_LINESTRIPS to 100% white,
> irrespective of their orientation and normal (which I've defined as
> [0,0,1]).

You should set the PFGS_COLOR4 attribute to define the line colour. If
the whole line is white you can use a pfVec4 array with one element
containing (1.0, 1.0, 1.0, 1.0) and bind it with PFGS_OVERALL binding
i.e. one colour for the whole line.

> I've tried applying a pfGeoState to the lines, with the following material
> properties, but it has no effect:
>
> gstate_wireline = new pfGeoState();
> pfMaterial *mtl = new pfMaterial;
> mtl->setColor( PFMTL_AMBIENT, 1.0, 1.0, 1.0 );
> mtl->setColor( PFMTL_DIFFUSE, 1.0, 1.0, 1.0 );
> gstate_wireline->setAttr( PFSTATE_FRONTMTL, mtl );
> gstate_wireline->setAttr( PFSTATE_BACKMTL, mtl );
> gset->setGState( gstate_wireline );

In the pfGeoState don't assign a material but disable lighting by:
gstate_wireline->setMode(PFSTATE_ENLIGHTING, PF_OFF);

and probably turn off texturung with:
gstate_wireline->setMode(PFSTATE_ENTEXTURE, PF_OFF);

Alternatively, if you *really* wanted to keep lighting & a material, you
could set the EMISSIVE component to 1.0, 1.0, 1.0. The component if not
affected by any light sources.

> Are lines 'special' in this respect?

No, not really. All the above can be done with all primitive types.

> suggestions gratefully received

This should be well documented in the Performer programming guide, I
suggest you read that

Regards, Simon
_______________________________________________________________________

Simon 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 2b29 : Fri Nov 10 2000 - 00:09:21 PST

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