Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

NTGraph3D (OpenGL) color?

i am working on some project requiring 3D display to plot surface.

NTGraph3d does just about everything I need and it has quite simple interface:

http://www.codeproject.com/KB/openGL/ntgraph3d_atl...

The problem is setting color of the element. It always seem to be applied to all elements not just selected one. This makes features of the surface not recognizable. All I need is to plot surface where elevation is different color. Any more effects (lighting, shades, etc.) is not essential. Any help?

1 Answer

Relevance
  • Iby K
    Lv 7
    1 decade ago
    Favorite Answer

    i have the same problem, ElementLineColor has only one parameter (ID) and issue is how to properly use element ID (not documented). I tried to combine it like ID=I*MAxX+J but it did not work.

    following code at least gives transition or color gradient from one line to next:

    NTGraph3D.ClearGraph

    NTGraph3D.AddElement

    NTGraph3D.Caption = ""

    For j = 0 To MaxX-1

    For i = 0 To MaxY -1

    NTGraph3D.AddElement

    ID=j ' ID=i*MaxX+J does not work!?

    NTGraph3D.ElementType(ID) = 0 ' 0 = element type line

    X = i

    y = j

    Z = dataarray(i, j)

    col = Abs((Z + 2) * 50) Mod 255

    NTGraph3D.ElementLineColor(ID) = RGB(j Mod 255, j Mod 255, 255 - col Mod 255)

    NTGraph3D.PlotXYZ X, Z, y, ID '(j Mod 128) + 1 'col

    Next

    Next

    NTGraph3D.AutoRange

Still have questions? Get your answers by asking now.