Creating plane/rectangle

Hello, I want to add the line in 3D, when I selected two points, using entities.add{} function.
Can I do this?

Yes you can do that as same as you’ve done above. Collect coordinates and draw Polyline. Check this sandcastle example.

  • Regards

Thank you, I would like to use the command below, var orangeOutlined = viewer.entities.add({
name:
“Orange line with black outline at height and following the surface”,
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
-75,
39,
250000,
-125,
39,
250000,
]),
width: 5,
material: new Cesium.PolylineOutlineMaterialProperty({
color: Cesium.Color.ORANGE,
outlineWidth: 2,
outlineColor: Cesium.Color.BLACK,
}),
},
});

but I am not sure about the “position” part. What are the coordinates of the position supposed to be?

I don’t understand how to determine the normal vector for creating Plane,
https://cesium.com/learn/cesiumjs/ref-doc/Plane.html
how i can determine it ? how can I get cartesian coordinates of normal vector?

I’m not understanding what you exactly want to ask.
It is converting World coordinates(degrees) Array to Cartesian3 Array where -75 is longitude, 39 is latitude and 250000 is height/altitude. Cartesian3 is in the format of x,y,z
You can convert single coordinate to Cartesian3 by Cesium.Cartesian3.fromDegrees(-75, 39, 250000)

I hope it helps you. I request you to please create a separate post for separate topic.

  • Regards,