Hello Jie,

Jie Liu wrote:
> However, when displaying the scene, the quad is pure red. What could be the
> problem? Will OpenSG blend the scene and the background?
> Or there are additional options to enable blending?

as David already explained, you need a BlendChunk on the material to 
enable the blending and control the exact blend mode used.
Note also that OpenSG does back to front rendering of transparent 
objects. However, it only sorts on the level of individual objects (i.e. 
  Geometries) not polygons (that would be very expensive as you'd need 
to do depth peeling or something similar). To determine an objects 
distance from the camera the center of the bounding box is used.

> =====================
> BTW, what is the right way to change the values of a GeoColors4f object.
> I checked some tutorial code, the manners to change the value of Nodecore
> objects are very confusing. Below are some examples.
> 
> For a GeoTexCoords2f object, we can change its values in this way:
> tex->push_back(tex_value);        // this seems the most common way, quite
> intuitive

this one goes through the generic interface of the properties and 
converts the input data to a generic type and then back to the stored 
type so for frequent/many changes it is less efficient than accessing 
the field directly as in the next two examples. The advantage of the 
generic interface is that you don't necessarily have to know the exact 
type of a property which reduces the number of cases you have to handle 
in generic code.

> however, for a GeoTexCoords1fPtr object, in this way:
> tex->*getField().*push_back(tex_value);  // we have to get field before we
> push back values, why?
> 
> As a constrast, for a GeoColors4f object, We have to do like this
> color->*getFieldPtr()->*push_back(color_value);      // this time, we have
> to get the *pointer* of its field before we add values...

either way works and there is not really a difference. Since variables 
of reference type must be initialized when defining them, it is 
sometimes more convenient to use the pointer versions, especially if you 
write code where a certain property may or may not be always present.

        Cheers,
                Carsten


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to