ThreeJS - ExtrudeGeometry depth gives different result than extrudePath

前端 未结 2 1859
太阳男子
太阳男子 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:39

    You are not doing anything wrong. What you are seeing is a consequence of how the algorithm is implemented. Consider it a "feature".

    When you extrude a shape along a path, the shape is free to "spin", and the initial orientation is arbitrary.

    Imagine if you were extruding along a closed 3D loop. When you get back to the starting point, the shape must have the same orientation it started with, so the ends of the extrusion match up. The algorithm must have the flexibility to handle this situation.

    EDIT: When you extrude along a path, the algorithm computes a series of slowly-varying Frenet Frames. (Look at the Wikipedia animations.) These Frenet Frames determine how the shape is oriented along the path. The extrusion algorithm determines the orientation of the initial Frenet Frame, and that initial orientatioin can result in a "spinning" of the shape.

    three.js r.68

提交回复
热议问题