So basically it has the same inputs as the camera facing GreasedLine plus ribbonOptions
in adition.
const wingsPoints =
[
[
4, -4, 0,
5, -2, 0,
5, 2, 0,
3.5, 7, 0
],
[
-4, -4, 0,
-5, -2, 0,
-5, 2, 0,
-3.5, 7, 0
]
]
const tieDrone = BABYLON.CreateGreasedLine("tie-drone", {
points: wingsPoints,
ribbonOptions: {
pointsMode: BABYLON.GreasedLineRibbonPointsMode.POINTS_MODE_POINTS,
direction: new BABYLON.Vector3(0, 0, 1),
},
}, {
color: BABYLON.Color3.Gray(),
cameraFacing: false,
width: 4,
colorMode: BABYLON.GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY
})
In pointsMode: BABYLON.GreasedLineRibbonPointsMode.POINTS_MODE_POINTS
it needs a second parameter called direction: Vector3
. The line will be stretched along the line defined by the points
to both sides in the direction defined by this vector. One can visualize the line points easily:
BABYLON.CreateGreasedLine("debug", {
points: wingsPoints
})
The cockpit is drawn in pointsMode: BABYLON.GreasedLineRibbonPointsMode.POINTS_MODE_PATHS
where each line in points
represents a path. These path are connected to create the mesh.
This is how you get the final mesh:
All info about the new mode will be in the docs next week. Hope you all will enjoy it and find it cool!
@Calsa