示例#1
0
文件: box.cpp 项目: twluo/RayTracer
void box::draw() {
	drawWireBox(min.x, min.y, min.z, max.x, max.y, max.z);
}
示例#2
0
void ProxyViz::draw( M3dView & view, const MDagPath & path, 
							 M3dView::DisplayStyle style,
							 M3dView::DisplayStatus status )
{
	if(!m_enableCompute) return;
	MObject thisNode = thisMObject();
	updateWorldSpace(thisNode);
	
	MPlug mutxplug( thisNode, axmultiplier);
	MPlug mutyplug( thisNode, aymultiplier);
	MPlug mutzplug( thisNode, azmultiplier);
	setScaleMuliplier(mutxplug.asFloat(), 
						mutyplug.asFloat(),
						mutzplug.asFloat() );	
                        
    MPlug svtPlug(thisNode, adisplayVox);
    setShowVoxLodThresold(svtPlug.asFloat() );
	
	MDagPath cameraPath;
	view.getCamera(cameraPath);
	if(hasView() ) updateViewFrustum(thisNode);
	else updateViewFrustum(cameraPath);
	
	setViewportAspect(view.portWidth(), view.portHeight() );
	
	MPlug actp(thisNode, aactivated);
	if(actp.asBool()) setWireColor(.125f, .1925f, .1725f);
    else setWireColor(.0675f, .0675f, .0675f);

	_viewport = view;
	fHasView = 1;
	
	view.beginGL();
	
	double mm[16];
	matrix_as_array(_worldInverseSpace, mm);
	
	glPushMatrix();
	glMultMatrixd(mm);	
	
	ExampVox * defBox = plantExample(0);
	updateGeomBox(defBox, thisNode);
	drawWireBox(defBox->geomCenterV(), defBox->geomScale() );
	Matrix44F mat;
	mat.setFrontOrientation(Vector3F::YAxis);
	mat.scaleBy(defBox->geomSize() );
    mat.glMatrix(m_transBuf);
	
	drawCircle(m_transBuf);
	
	drawGridBounding();
	// drawGrid();

	if ( style == M3dView::kFlatShaded || 
		    style == M3dView::kGouraudShaded ) {		
		drawPlants();
	}
	else 
		drawWiredPlants();
	
    if(hasView() ) drawViewFrustum();
    
	drawBrush(view);
	drawActivePlants();
	drawGround();
	glPopMatrix();
	view.endGL();
	std::cout<<" viz node draw end";
}