COpenGL::ApplyObjectInfo

static void ApplyObjectInfo( SObjectInfo* ObjectInfo );

Parameters

ObjectInfo Pointer to the SObjectInfo structure which stores information about the object

Remarks

The ApplyObjectInfo method is used mostly in main rendering procedure of the scene. Applies object information such as object translation and rotation to the current projection and modelview matrix.

This method is available from ClassGL version 3.0

Example

void COpenGLSampleView::OnDraw( CDC* pDC )
{
  // save current "world view" matrix
  glPushMatrix();
  // apply object info to display object on proper position/rotation
  m_OpenGL.ApplyObjectInfo( & m_Object.m_ObjectInfo );
  // draw the object
  m_Object.Draw();

  //////////////////////////////////////////////////
  // draw sub objects1 of the object
  // save current matrix
  glPushMatrix();
  // apply object info to display subobject on proper position/rotation
  m_OpenGL.ApplyObjectInfo( & m_Object.m_SubObject1.m_ObjectInfo );
  // draw the object
  m_Object.m_SubObject1.Draw();
  // restore the previous matrix
  glPopMatrix();

  //////////////////////////////////////////////////
  // draw sub objects2 of the object
  // save current matrix
  glPushMatrix();
  // apply object info to display subobject on proper position/rotation
  m_OpenGL.ApplyObjectInfo( & m_Object.m_SubObject2.m_ObjectInfo );
  // draw the object
  m_Object.m_SubObject2.Draw();
  // restore the previous matrix
  glPopMatrix();

  // Note that Parent items of the m_SubObject1.m_ObjectInfo and
  // m_SubObject2.m_ObjectInfo should point to the 
  // m_Object.m_ObjectInfo structure to allow  correct manipulation of
  // the sub-objects by ClassGL
	
  // restore the "world view" matrix
  glPopMatrix();
}

See Also

SetManipulatedObject