Re: Associating material with texture

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (aschaffe)
Tue, 4 Apr 1995 16:30:40 -0700


On Mar 21, 9:56am, Henrik Lind wrote:
> Re: Performer 1.2
>
> Hello. I am tasked with associating a material with a sequence of
> objects in an animation. The animation is developed by adding
> pfGroup's as children to a pfSequence. (this is someone else's code)
>
> I want to associate a material with the animation and then color it,
> by adjusting the material diffuse and ambient. I know how to color
> a material, once I have it, but it's the associating of material to
> elements of the sequence that I don't know.
>
> Can you give me direction?

A long chain of connections here. Ultimately your pfSequences
contain pfGeode nodes at the leaves. pfGeode's contain pfGeoSets'
(representing the geometry) and the pfGeoSets refer to a pfGeoState
(representing all the state elements like pfMaterial, pfTexture,
etc.)

More visually..

  pfSequence->...->pfGeode\ <- scene graph
                           \
>(pfGeoSet->pfGeoState <- within pfGeode

once you have a handle to the pfGeoState, you can create a pfMaterial
object and bind the material to the pfGeoState.

Another possibility if you don't mind the entire object having the
same pfGeoState -- several of the loaders (LoadFlt, etc) allow you to
specify a "default" pfGeoState for all of the geosets the loader
creates. You just create a (default) pfGeoState and pass it along
to the loader. See the function headers for LoadFlt() and others
for the details.

Allan

-- 
Allan Schaffer                                                aschaffe++at++sgi.com
Silicon Graphics                     http://reality.sgi.com/employees/aschaffe

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:10 PDT

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