Menu

#4 Random colormap function

open
None
6
2002-12-06
2002-12-06
No

We need functionality for assigning a random colormap
to the values in the displayed volume.

(Would also need some configuration: on, off, generate
new, etc.)

Discussion

  • Kristoffer Gleditsch

    • assigned_to: nobody --> toffer
     
  • Johan Seland

    Johan Seland - 2003-02-27

    Logged In: YES
    user_id=623121

    This can be done as follows:

    Generate three arrays with random values, one each for R, G
    and B.
    (Blitz++ provides several random number generators.)
    Use glPixelMap* to load the arrays before the call to
    glPixelDraw.
    Change glPixelDraw to use GL_COLOR_INDEX instead of
    GL_LUMINANCE.

    As an added bonus the gain/offset feature Lars requests
    could be implemented when generating the arrays. Simply let
    value lower/higher than the cutoff values be zero in _all_
    of the arrays.

    There should of course be a button which can generate a new
    random colormap.

    Page 319 in the Red Book has a nice illustration
    demonstrating how the operations are applied.

     

Log in to post a comment.