Re: [info-performer] Transparent sphere

Date view Thread view Subject view Author view

From: Bram Stolk (bram++at++sara.nl)
Date: 12/06/2005 01:44:15


Rajesh R wrote:
>
>
> Dear Performers,
>
> Is it possible to create transparent sphere.
> The sphere is created using pfdNewSphere(2000,areana). What attributes
> should be set for rendering it as a transparent.

pfdNewSphere gives you only a GeoSet.
You need three performer objects to do this:

pfGeoSet

pfGeoState

pfMaterial

If your sphere is always viewed from the outside, I strongly suggest
enabling back face culling.

You need to enable transparency on the geostate, and set the
front mtl to the newly created mtl.

Something like:

material = new pfMaterial();
material->setAlpha(0.5);

geostate = new pfGeoState();
geostate->makeBasic();
geostate->setMode(PFSTATE_ENLIGHTING, PF_ON);
geostate->setAttr(PFSTATE_FRONTMTL, mat);
geostate->setMode(PFSTATE_TRANSPARENCY, PFTR_ON);

geoset->setGState(geostate);

Then, ofcourse, you also need to add the geoset to the geode,
so that would be 4 pf objects :-)

  Bram

>
>
>
> Rajesh.R
> Virtual Reality
> Institute for Robotics and Virtual Reality
> c/o Centre for AI and Robotics
> Defence Research and Development Organization (DRDO)
> Ministry of Defence
> Bangalore - 1
>
>
>
> Scientists are people of very dissimilar temperaments
> doing different things in very different ways. Among
> scientists are collectors, classifiers and compulsive
> tidiers-up; many are detectives by temperament and many
> are explorers; some are artists and others artisans.
> There are poet-scientists and philosopher-scientists and
> even a few mystics."
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
>

-- 
Bram Stolk, VR Engineer SARA, Amsterdam.   tel +31 20 592 3000

"Windows is a 32-bit extension to a 16-bit graphical shell for an 8-bit operating system originally coded for a 4-bit microprocessor by a 2-bit company that can't stand 1 bit of competition."


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Dec 06 2005 - 01:47:35 PST