我将我的 3D 点(许多点)存储在一个TGLPoints
对象中。场景中除了点之外没有其他对象。绘制点时,我想让它们适合屏幕,这样它们就不会看起来太远或太近。我试过TGLCamera.ZoomAll
但没有成功,这里给出的解决方案是调整相机位置、景深和场景比例:
objSize:=YourCamera.TargetObject.BoundingSphereRadius;
if objSize>0 then begin
if objSize<1 then begin
GLCamera.SceneScale:=1/objSize;
objSize:=1;
end else GLCamera.SceneScale:=1;
GLCamera.AdjustDistanceToTarget(objSize*0.27);
GLCamera.DepthOfView:=1.5*GLCamera.DistanceToTarget+2*objSize;
end;
这次这些点没有出现在屏幕上。
我应该怎么做才能使 3D 点适合屏幕?