ActiViz学习点滴(五)——坐标变换

该博客详细介绍了在VTK(Visualization Toolkit)中如何使用vtkTransform进行三维图形的平移、旋转和缩放操作。通过实例展示了不同操作顺序对图形效果的影响,并附带了相应的程序代码和执行结果,揭示了图形变换的原理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

程序修改如下:

            vtkSphereSource sphere0 = vtkSphereSource.New();

            vtkSphereSource sphereX = vtkSphereSource.New();
            sphereX.SetCenter(5, 0, 0);
            vtkSphereSource sphereY = vtkSphereSource.New();
            sphereY.SetCenter(0, 5, 0);
            vtkSphereSource sphereZ = vtkSphereSource.New();
            sphereZ.SetCenter(0, 0, 5);

            vtkCylinderSource cylinder = vtkCylinderSource.New();
            cylinder.SetHeight(3.0);
            cylinder.SetRadius(0.1);
            cylinder.SetResolution(10);

            vtkPolyDataMapper sphere0Mapper = vtkPolyDataMapper.New();
            sphere0Mapper.SetInputConnection(sphere0.GetOutputPort());

            vtkPolyDataMapper sphereMapperX = vtkPolyDataMapper.New();
            sphereMapperX.SetInputConnection(sphereX.GetOutputPort());

            vtkPolyDataMapper sphereMapperY = vtkPolyDataMapper.New();
            sphereMapperY.SetInputConnection(sphereY.GetOutputPort());

            vtkPolyDataMapper sphereMapperZ = vtkPolyDataMapper.New();
            sphereMapperZ.SetInputConnection(sphereZ.GetOutputPort());

            vtkPolyDataMapper cylinderMapper = vtkPolyDataMapper.New();
            cylinderMapper.SetInputConnection(cylinder.GetOutputPort());

           

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值