Exemplo n.º 1
0
void CCharShape::DrawNodes (const TCharNode *node) {
	glPushMatrix();
	glMultMatrix(node->trans);

	if (node->node_name == highlight_node) highlighted = true;
	const TCharMaterial *mat;
	if (highlighted && useHighlighting) {
		mat = &Highlight;
	} else {
		if (node->mat != NULL && useMaterials) mat = node->mat;
		else mat = &TuxDefMat;
	}

	if (node->visible == true) {
		set_material (mat->diffuse, mat->specular, mat->exp);

		DrawCharSphere (node->divisions);
	}
// -------------- recursive loop -------------------------------------
	TCharNode *child = node->child;
	while (child != NULL) {
		DrawNodes (child);
		if (child->node_name == highlight_node) highlighted = false;
		child = child->next;
	}
// -------------------------------------------------------------------
	glPopMatrix();
}
Exemplo n.º 2
0
void CCharShape::DrawNodes (TCharNode *node) {
    TCharNode *child;
    glPushMatrix();
	GLfloat trans[16];
	for ( int i = 0; i < 16; i++ ) {
		trans[i] = ((const double*)node->trans)[i];
	}
	glMultMatrixf (trans);

	if (node->node_name == highlight_node) highlighted = true;
	TCharMaterial *mat; 
	if (highlighted && useHighlighting) {
		mat = &Highlight;
	} else {
		if (node->mat != NULL && useMaterials) mat = node->mat; 
		else mat = &TuxDefMat;
	}

	if (node->visible == true) {
		set_material (mat->diffuse, mat->specular, mat->exp);
		DrawCharSphere (node->divisions);
	}
 
// -------------- recursive loop -------------------------------------
	child = node->child;
	while (child != NULL) {
		DrawNodes (child);
		if (child->node_name == highlight_node) highlighted = false;
		child = child->next;
	} 
// -------------------------------------------------------------------
    glPopMatrix();
}