Ejemplo n.º 1
0
void ModelBody::RenderLmrModel(const vector3d &viewCoords, const matrix4x4d &viewTransform)
{
	float znear, zfar;
	Pi::worldView->GetNearFarClipPlane(&znear, &zfar);
	
/*	if (viewCoords.Length() > zfar) {
		vector3d pos = viewCoords;

		glPointSize(1.0);
		glDisable(GL_LIGHTING);
		glColor3f(1,1,1);
		glBegin(GL_POINTS);
		pos = pos.Normalized() * 0.99*(double)zfar;
		glVertex3dv(&pos[0]);
		glEnd();
		glEnable(GL_LIGHTING);
	} else {*/
		matrix4x4d t = viewTransform * GetInterpolatedTransform();
		matrix4x4f trans;
		for (int i=0; i<12; i++) trans[i] = float(t[i]);
		trans[12] = viewCoords.x;
		trans[13] = viewCoords.y;
		trans[14] = viewCoords.z;
		trans[15] = 1.0f;


		m_lmrModel->Render(trans, &m_params);

		glDisable(GL_BLEND);
		glEnable(GL_LIGHTING);
		glDisable(GL_NORMALIZE);
//	}
}
Ejemplo n.º 2
0
void ModelBody::RenderLmrModel(const vector3d &viewCoords, const matrix4x4d &viewTransform)
{
	matrix4x4d t = viewTransform * GetInterpolatedTransform();
	matrix4x4f trans;
	for (int i=0; i<12; i++) trans[i] = float(t[i]);
	trans[12] = viewCoords.x;
	trans[13] = viewCoords.y;
	trans[14] = viewCoords.z;
	trans[15] = 1.0f;

	m_lmrModel->Render(trans, &m_params);
}
Ejemplo n.º 3
0
matrix4x4d Body::GetInterpolatedTransformRelTo(const Frame *relTo) const
{
	matrix4x4d m;
	Frame::GetFrameRenderTransform(m_frame, relTo, m);
	return m * GetInterpolatedTransform();
}