小编mar*_*rks的帖子

Laravel 存储符号:链接在本地环境中不起作用

我使用默认的 laravel 文件夹结构和文件系统public

'public' => [
    'driver'     => 'local',
    'root'       => storage_path('app/public'),
    'url'        => env('APP_URL') . '/storage',
    'visibility' => 'public',
],
Run Code Online (Sandbox Code Playgroud)

一切都在 docker 上运行,完整的 laravel 文件夹安装到/var/www/html

#... Laravel PHP-FPM service definition
  volumes:
    - "./:/var/www/html"
#...
Run Code Online (Sandbox Code Playgroud)

当我运行php artisan storage:link然后cd /var/www/html/publicls -la看到符号链接存在:

lrwxr-xr-x 1 root root 32 May 5 11:19 storage -> /var/www/html/storage/app/public

如果我然后检查链接的文件夹是否也存在于容器中,cd /var/www/html/storage/app/public则一切都按预期存在。

另外,直接检查时ls -la /var/www/html/public/storage/它会显示链接文件夹的内容。所以从符号链接的角度来看一切都正常

# ls -la /var/www/html/public/storage/
total 512
drwxr-xr-x  4 www-data www-data …
Run Code Online (Sandbox Code Playgroud)

symlink storage laravel docker

7
推荐指数
1
解决办法
5976
查看次数

Three.js - 将平面缩放到全屏

我正在向场景中添加一架飞机,如下所示:

// Camera
this.three.camera = new THREE.PerspectiveCamera(45, window.innerWidth/window.innerHeight, 0.1, 60);
// Plane
const planeGeometry = new THREE.PlaneBufferGeometry(1,1,this.options.planeSegments,this.options.planeSegments);
const planeMat = new THREE.ShaderMaterial( ... )
this.three.plane = new THREE.Mesh(planeGeometry,planeMat);
this.three.scene.add(this.three.plane);
Run Code Online (Sandbox Code Playgroud)

很基本。我不是试图找出如何在 Z 轴上移动平面以填充浏览器视口。为了那个原因,

// See attachment "solving for this" is closeZ
const closeZ = 0.5 / Math.tan((this.three.camera.fov/2.0) * Math.PI / 180.0);
this.uniforms.uZMax = new THREE.Uniform(this.three.camera.position.z - closeZ);
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

所以现在我知道在我的着色器中我可以向 Z 添加多少来使平面填充视口。顶点着色器看起来像这样:

uniform float uZMax;

void main() {   
    vec3 pos = (position.xy, uZMax);
    gl_Position = projectionMatrix * modelViewMatrix * vec4( pos, 1 ); …
Run Code Online (Sandbox Code Playgroud)

javascript shader vector glsl three.js

5
推荐指数
2
解决办法
982
查看次数

由于 .make 文件中的语法错误,Valet-PHP 安装失败

我正在按照指南安装 valet-plus。不过,brew 文件中似乎有问题。运行brew install valet-php@7.4 --build-from-source安装命令时,出现以下错误:

Last 15 lines from /Users/markusreis/Library/Logs/Homebrew/valet-php@7.4/03.make:
    virtual bool operator==(const BreakIterator&) const = 0;
            ~~~~ ^
1 error generated.
make: *** [ext/intl/breakiterator/breakiterator_methods.lo] Error 1
1 error generated.
make: *** [ext/intl/breakiterator/codepointiterator_internal.lo] Error 1
In file included from /private/tmp/valet-phpA7.4-20220304-86241-1rnurk6/php-7.4.16/ext/intl/breakiterator/codepointiterator_methods.cpp:17:
/private/tmp/valet-phpA7.4-20220304-86241-1rnurk6/php-7.4.16/ext/intl/breakiterator/codepointiterator_internal.h:42:17: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool')
                virtual UBool operator==(const BreakIterator& that) const;
                        ~~~~~ ^
/usr/local/Cellar/icu4c/70.1/include/unicode/brkiter.h:127:18: note: overridden …
Run Code Online (Sandbox Code Playgroud)

homebrew laravel laravel-valet

5
推荐指数
1
解决办法
3486
查看次数

在glsl和三个js中将粒子从鼠标位置推开

我的THREE.Points对象有以下设置:

        this.particleGeometry = new THREE.BufferGeometry()
        this.particleMaterial = new THREE.ShaderMaterial(
            {
                vertexShader: vshader,
                fragmentShader: fshader,
                blending: THREE.AdditiveBlending,
                depthWrite: false,
                uniforms: {
                    uTime: new THREE.Uniform(0),
                    uMousePosition: this.mousePosition
                }
            }
        )
Run Code Online (Sandbox Code Playgroud)

然后一些代码将点放置在BufferGeometry球体上。那工作正常。

粒子球

我还设置了一个 Raycaster 来跟踪与隐藏平面相交的鼠标位置,然后相应地更新制服uMousePosition。这也很好用,我将鼠标位置发送到我的顶点着色器。

现在我试图让离d鼠标有一定距离的粒子远离它,当然最接近的粒子被推开,并且还将重力施加回它们的原始位置以在一段时间后恢复一切。

所以这是我的顶点着色器中的内容:

void main() {
float lerp(float a, float b, float amount) {
    return a + (b - a) * amount;
}

void main() {
    vec3 p = position;

    float dist = min(distance(p, mousePosition), 1.);

    float lerpFactor = .2;

    p.x …
Run Code Online (Sandbox Code Playgroud)

shader glsl three.js

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