opengl improvements and fixes

This commit is contained in:
Joachim Schoeberl 2011-11-14 18:17:54 +00:00
parent f8b82a24eb
commit da9df250d5

View File

@ -3833,25 +3833,16 @@ namespace netgen
&jacobi[0](0), &jacobi[1](0)-&jacobi[0](0), &jacobi[0](0), &jacobi[1](0)-&jacobi[0](0),
&mvalues[0], sol->components); &mvalues[0], sol->components);
// cout << "have multivalues, comps = " << sol->components << endl;
if (!drawelem) ok = false; if (!drawelem) ok = false;
if (usetexture != 2) if (usetexture != 2 || !sol->iscomplex)
for (int ii = 0; ii < nlp; ii++) for (int ii = 0; ii < nlp; ii++)
vals[ii] = ExtractValue(sol, scalcomp, &mvalues[ii*sol->components]); vals[ii] = ExtractValue(sol, scalcomp, &mvalues[ii*sol->components]);
} else
for (int ii = 0; ii < nlp; ii++)
for (int j = 0; ok && j < 3; j++) valsc[ii] = complex<double> (mvalues[ii*sol->components],
{ mvalues[ii*sol->components+1]);
p[j] = points[trig.points[j].pnr].p;
Point<3> ploc = points[trig.points[j].pnr].lami;
if (deform)
p[j] += GetDeformation (trig.elnr, ploc);
if (usetexture == 2 && sol->iscomplex)
{
ok = GetValueComplex (sol, trig.elnr, ploc(0), ploc(1), ploc(2),
scalcomp, valc[j]);
}
} }
if(ok) if(ok)
@ -3860,7 +3851,16 @@ namespace netgen
if (usetexture != 2 || !sol->iscomplex) if (usetexture != 2 || !sol->iscomplex)
SetOpenGlColor (vals[trig.points[j].locpnr]); SetOpenGlColor (vals[trig.points[j].locpnr]);
else else
glTexCoord2f ( valc[j].real(), valc[j].imag() ); glTexCoord2f ( valsc[trig.points[j].locpnr].real(),
valsc[trig.points[j].locpnr].imag() );
p[j] = points[trig.points[j].pnr].p;
if (deform)
{
Point<3> ploc = points[trig.points[j].pnr].lami;
p[j] += GetDeformation (trig.elnr, ploc);
}
glVertex3dv (p[j]); glVertex3dv (p[j]);
} }