Hi Clement,

This really isn't an OSG question, or at least answering isn't an OSG
question, it's really one of how to teach you how to program.  You
have a for loop with a constant r,g,b value and varying i value and
you are stuck on how to vary r,g,b.  How about using arrays for them?
There are so many ways you can do but only YOU can answer how you want
to provide the colours and how you want to map them.  This type of
problem really is a pretty basic programming issue that isn't anything
todo with the OSG, and something I would have expect most engineers to
know how to do quite early in their careers.

I have to ask are you new to programming?  It might be we that can
suggest some general background reading to help you on your way.

Robert.

On 14 May 2012 14:00,  <clement....@csiro.au> wrote:
> Hi Robert,
>
>   I would like to know how to generate colour map.  Except rgb, the alpha is 
> very important, so each colour I would like to use much alpha.
>
>
>    If there is 1 colour, I can do like this.
>
>         osg::TransferFunction1D::ColorMap colorMap;
>         for (int i=0; i<255; i++)
>                colorMap[i] = osg::Vec4((float)r/255, (float)g/255, 
> (float)b/255, (float)i/255);
>
>
>   If the colour are more than 10, what the colour map looks like?
>
>
>    Currently, I am using osgVolume without created colour map, but I believe 
> there is somewhere defined the colour map.  Do you know where I can find the 
> code?  Thanks again.
>
>
> Regards,
> Clement
>
>
>
>
>
> ________________________________________
> From: osg-users-boun...@lists.openscenegraph.org 
> [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
> [robert.osfi...@gmail.com]
> Sent: Monday, 14 May 2012 9:07 PM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] osgvolume brightness and sample density
>
> Hi Clement,
>
> On 8 May 2012 08:44,  <clement....@csiro.au> wrote:
>>  Thanks for your help.  The colour map in the osgvolume.cpp example contains 
>> specific colour.  I would like to implement full range of colours as 
>> possible supported by osg.  Any idea what I can do to create a colour map of 
>> full range colours.  Thanks.
>
> I don't know what you actually mean by "a colour map of full range
> colours", so can't answer your question.  What are you intending here,
> to map the intensity values from the 3d image data to a specific
> colour, which is what the TransferFunction1D is for, or from colour to
> colour which is rather more open ended.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to