📜  BabylonJS-参数形状

📅  最后修改于: 2020-10-27 03:29:38             🧑  作者: Mango


参数形状是指可以使用通过弯曲,扭曲等绘制的线来实现的不同形状。它是通过数学方程(如抛物线,正弦曲线,cos曲线,贝塞尔曲线等)生成的2D形式。有了该方程,我们可以找到坐标(x,y)并为其绘制直线。在本章中,我们将看到带状,线状,虚线,管状,挤压等形状。可以使用下面描述的参数形状自由绘制板上的线条。

Sr.No. Parametric Shape & Description
1 Ribbon

Ribbon takes an array of paths as input and draws lines along those paths. It uses complex logic to get the co-ordinates. In the example given below, we have used Bezier curve equation to draw the ribbon. Bezier curves are mostly used in 3D games to model the smooth curves. The curve needs control points and the curve is drawn along the control points.

2 Line

Line is a basic element in 3D games. To draw a line, you need two points between which you can draw a line.

3 Tube

Tube is a curved cylinder shape. It can give different parametric shapes based on the equation (maths function) applied to it to get the co-ordinates.

4 Extrusion

Extrusion helps in transforming a 2D shape into a volumic shape.Suppose you want to create a star with 2D you will have x,y co-ordinates and z will be 0.Taking the 2D co-ordinates extrusion will convert the same to a 3D shape.So, the start of 2D with extrusion will turn out to be a 3D.You can try different 2D shapes and convert those into 3D.