摆正模型再俯视
This commit is contained in:
parent
844b727409
commit
cf4ec1db7a
@ -114,6 +114,9 @@ namespace NavisworksTransport.Utils
|
||||
// 3. 创建当前视角的副本(关键:使用 CreateCopy 而不是 new Viewpoint())
|
||||
Viewpoint newViewpoint = doc.CurrentViewpoint.Value.CreateCopy();
|
||||
|
||||
// 使用无旋转来摆正视图
|
||||
newViewpoint.Rotation = new Rotation3D();
|
||||
|
||||
// 设置标准俯视图的相机配置
|
||||
// 相机位置:在目标正上方
|
||||
newViewpoint.Position = cameraPosition;
|
||||
@ -124,9 +127,7 @@ namespace NavisworksTransport.Utils
|
||||
// 使用 AlignUp 设置向上向量(适配不同坐标系)
|
||||
newViewpoint.AlignUp(cs.UpVector);
|
||||
|
||||
// 注意:用户的 Y-Up 模型是旋转过的(+Y 180度,X 270度)
|
||||
// 所以不能使用无旋转来摆正视图,需要后续研究如何处理
|
||||
// newViewpoint.Rotation = new Rotation3D();
|
||||
|
||||
|
||||
// 4. 扩展路径包围盒,避免边缘贴得太近
|
||||
double boxWidth = viewBoundingBox.Max.X - viewBoundingBox.Min.X;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user