Primitive added via scene.primitives.add not displaying

I’m having trouble getting a line to display in the viewer when I add it via a scene.primitive.

What am I missing?

2 Likes

Initializing a polyline in the add function of PolylineCollection is a bit different than what you have. You don’t need the polyline key in the map. Something like this should work: Sandcastle.

You can see the possible options for Polyline here: Documentation.

2 Likes

Ah thank you! That worked. How do I ensure that line stays clamped to the ground?

Glad to help!

There isn’t a clampToGround tag for Polyline. I would go with Entity in this case.