Hello naresh,

naresh wrote:
> In OpenSG 2.0 anyone tested Gradient Background class ? I am facing some 
> problem . When I am attaching Gradient Background  torus is not 
> displaying . Is there any sequence to maintain ?

since the SSM creates some objects internally there is a sort of 
sequence to maintain when using it and then manipulating 
camera/viewport/foreground/background. The function that triggers the 
creation is setRoot, so changing or using the above objects of the SSM 
requires a call to setRoot first (I've used a dummy call with NULL as 
argument in the past to work around this).
But your code already does the setRoot call first, so that is not the 
problem here.

> Please find attached code for reference if anyone can help me is 
> appreciated .

// Create Background
GradientBackgroundRefPtr gradBack = GradientBackground::create();
gradBack->addLine(Color3f(0.87f,0.85f,0.76f),0);
gradBack->addLine(Color3f(0.57f,0.54f,0.32f),5);
                                            ^^^^^
did you mean 0.5f? By default the GB takes normalized coordinates, i.e. 
ones in [0,1] unless you call setNormPosition(false).
hm, according to my test run that is not the problem either...

What revision of OpenSG 2.0 are you using? A little while ago I fixed a 
bug that left the wrong matrix stack active (r1850), that might be what 
you are running into.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to