X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fgraph3dview.cpp;h=37a3dede7adf32c04d014802e3621ba2bcf20d0a;hb=HEAD;hp=dbcd2b070c44432746cbd8a9119758f301c37d9d;hpb=d7bdb504267eaac64947a1622540bb7f75ab7c27;p=ctsim.git diff --git a/src/graph3dview.cpp b/src/graph3dview.cpp index dbcd2b0..37a3ded 100644 --- a/src/graph3dview.cpp +++ b/src/graph3dview.cpp @@ -451,10 +451,10 @@ Graph3dFileView::InitMaterials() int ny = GetDocument()->ny(); #if 1 - static float position0[] = {nx/2, ny*2, -ny*2, 0.0f,}; + static float position0[] = {nx/2.0f, ny*2.0f, -ny*2.0f, 0.0f,}; static float ambient0[] = {.1f, .1f, .1f, 1.0f}; static float diffuse0[] = {1.0f, 1.0f, 1.0f, 1.0f}; - static float position1[] = {-nx/2, -ny*2, -ny*2, 0.0f,}; + static float position1[] = {-nx/2.0f, -ny*2.0f, -ny*2.0f, 0.0f,}; static float ambient1[] = {.1f, .1f, .1f, .1f}; static float diffuse1[] = {1.0f, 1.0f, 1.0f, 1.0f}; // static float position0[] = {0.0f, 0.0f, 20.0f, 0.0f}; @@ -605,7 +605,7 @@ Graph3dFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) if (v != NULL && nx != 0 && ny != 0) { double min = v[0][0]; double max = min; - for (unsigned int ix = 0; ix < nx; ix++) + for (unsigned int ix = 0; ix < nx; ix++) { for (unsigned int iy = 0; iy < ny; iy++) { double dVal = v[ix][iy]; if (min > dVal) @@ -613,12 +613,13 @@ Graph3dFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) else if (max < dVal) max = dVal; } - m_dGraphMin = min; - m_dGraphMax = max; - if (! m_bColorScaleMinSet) - m_dColorScaleMin = min; - if (! m_bColorScaleMaxSet) - m_dColorScaleMax = max; + } + m_dGraphMin = min; + m_dGraphMax = max; + if (! m_bColorScaleMinSet) + m_dColorScaleMin = min; + if (! m_bColorScaleMaxSet) + m_dColorScaleMax = max; } double dRadius = maxValue (nx, ny) * SQRT2 / 2;