ThreeJS - ExtrudeGeometry depth gives different result than extrudePath

前端 未结 2 1852
太阳男子
太阳男子 2020-12-10 09:02

I use THREE.ExtrudedGeometry in two different ways and I expected the same result.

Once I use the depth to set the extrusion options. Another time I use an extrude

2条回答
  •  再見小時候
    2020-12-10 09:45

    the behavior can be explained if you look into the source code of THREE.ExtrudedGeometry and THREE.TubeGeometry.FrenetFrames

    here's in the comments of ExtrudeGeometry

    • extrudePath: // 3d spline path to extrude shape along. (creates Frames if .frames aren't defined)
    • frames: // containing arrays of tangents, normals, binormals

    so essentially, like WestLangley says, if extrudePath is specific, the geometry is extruded along a 3d spline path, and uses FrenetFrames for adjustment of rotation, unlike the simple approach of a normal extrusion.

    In THREE.TubeGeometry.FrenetFrames you might see commented code for the initialNormal1. You might uncomment those if you wish to explore different intial positions, or pass in a FrenetFrames of your intended behavior.

提交回复
热议问题