三。

发布于 2025-01-19 02:05:27 字数 792 浏览 1 评论 0原文

我正在尝试通过三个示例对象“ water2”来创建水面。

这是对象的演示: https://threejs.org/examples/?q=water#weater#webgl_water

i使用此代码来创建水面,该水面直接从演示代码:

    const waterGeometry = new THREE.PlaneGeometry( 16, 16 );
    water = new Water( waterGeometry, {
        color: '#aabbcc',
        scale: 4,
        flowDirection: new THREE.Vector2( 1, 1 ),
        textureWidth: 1024,
        textureHeight: 1024
    } );
    water.position.z = 0.1;
    scene.add( water );

水面渲染(如左图中看到);但是,水面在右图上的演示场景中不透明。这里有什么问题?我检查了演示,那里没有其他与水面相互作用的。尽管代码是1:1的副本,但它如何在我自己的实现中显示出如此不同的显示?

“

I'm trying to create a water surface via the three.js example object "water2".

This is a demo of the object:
https://threejs.org/examples/?q=water#webgl_water

I use this code to create the water surface, which is taken directly from the demo code:

    const waterGeometry = new THREE.PlaneGeometry( 16, 16 );
    water = new Water( waterGeometry, {
        color: '#aabbcc',
        scale: 4,
        flowDirection: new THREE.Vector2( 1, 1 ),
        textureWidth: 1024,
        textureHeight: 1024
    } );
    water.position.z = 0.1;
    scene.add( water );

The water plane renders (as you can see in the left image); However the water surface is not transparent like in the demo scene on the right image. What could be the issue here? I checked the demo and there is nothing else there that interacts with the water plane. How is it possible it displays so differently on my own implementation, despite code being a 1:1 copy?

mine vs demo implementation

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文