[VTK] Establish a coordinate system model in the scene

VTK establishes the coordinate system model in the scene

Create a coordinate system model in VTK for importing into the scene.


the code

vtkAxesActor* GenerateGlobalAxis()
{
    
    
	vtkAxesActor* axes = vtkAxesActor::New();
	axes->SetPosition(0, 0, 0);		//坐标系的原点位置
	axes->SetTotalLength(2, 2, 2);	//轴的长度
	axes->SetShaftType(0);	 //旋转轴的类型:圆柱体、线或者自定义(用于显示)
	axes->SetAxisLabels(1);  //是否显示标签
	axes->SetCylinderRadius(0.02);	//设置轴的半径(用于显示)
	
	return axes;  //用于插入到vtkRenderer中
}

result

VTK coordinate system

Guess you like

Origin blog.csdn.net/qq_37366618/article/details/124037937