小编Dav*_*vid的帖子

从命令行运行PHP脚本

如何使用用于解析Web脚本的PHP解释器从命令行运行PHP脚本?

我有一个phpinfo.php文件可以从German安装的网络节目中访问.但是,如果我运行phpinfo.php从使用命令行- php phpinfo.phpgrepGerman,我并不觉得.所以两个phps都不同.我需要运行该脚本phpGerman安装.

我怎样才能做到这一点?

php command-line

70
推荐指数
1
解决办法
18万
查看次数

将threejs透视相机转换为正交需要什么

我有一些代码可以将透视相机转换为正交相机。问题是当我进行转换时,模型变得非常小而且很难看。

我已经根据距离和 FOV 计算了正交相机的缩放系数。我是否需要在正交相机上设置任何其他属性(例如剪切平面等)?

我相信立场保持不变。我不确定我还需要计算什么。

    fieldOfView = viewInfo.fov;
var getCameraPosition = function() {
    return viewer._viewport._implementation.getCamera()._nativeCamera.position;
};

// Calculate the delta position between the camera and the object
var getPositionDelta = function(position1, position2) {
    return {
        x: position1.x - position2.x,
        y: position1.y - position2.y,
        z: position1.z - position2.z
    }
};

var getDistance = function(positionDelta, cameraDirection) {
    return dot(positionDelta, cameraDirection);
};

distance = getDistance(positionDelta, cameraDirection),
var depth = distance;

var viewportWidth = view.getDomRef().getBoundingClientRect().width;
var viewportHeight = view.getDomRef().getBoundingClientRect().height;
var aspect = viewportWidth / …
Run Code Online (Sandbox Code Playgroud)

javascript camera orthographic perspective three.js

2
推荐指数
1
解决办法
1965
查看次数