Code: Select all
glPointSize(6.0f;)
Code: Select all
glPointSize(6.0f;)
Code: Select all
// set the material
SMaterial theMat;
theMat.Thickness = 10;
driver->setMaterial(theMat);
// and maybe set the transformation
driver->setTransform(video::ETS_WORLD, core::matrix4());
// then draw the line(s)
Code: Select all
core::matrix4 mat1;
driver->setTransform(video::ETS_WORLD, mat1);
Spring *s = springs[i];
Vector3D st = bodies[s->ID1]->GetPos();
Vector3D en = bodies[s->ID2]->GetPos();
core::vector3df start(st[X], st[Y], st[Z]);
core::vector3df end(en[X], en[Y], en[Z]);
video::SColor col(255,255,255,255);
//Going to interpolate color to indicate compression or tension
if(s->GetStretch() < 0)
{
col = col.getInterpolated(video::SColor(255,255,64,64), (-s->GetStretch()/s->GetLength()));
}
else if(s->GetStretch() > 0)
{
col = col.getInterpolated(video::SColor(255,64,255,64), (s->GetStretch()/s->GetLength()));
}
video::SMaterial mat;
mat.Thickness = 10;
mat.DiffuseColor = col;
driver->setMaterial(mat);
driver->draw3DLine(start, end, col);
Code: Select all
// set the material
SMaterial theMat;
theMat.Thickness = 10;
driver->setMaterial(theMat);
// and maybe set the transformation
driver->setTransform(video::ETS_WORLD, core::matrix4());
// then draw the line(s)