我使用默认的 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/public
我ls -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) 我正在向场景中添加一架飞机,如下所示:
// 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) 我正在按照本指南安装 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) 我的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)