How to a scale primitive?

I found such an example of mashstabirvoaniya primitives in the topiq. Here is a link to Sandcatsle:Cesium Sandcastle

I need to scale primitives this way, but have the size of the primitive depend on the height of the camera from positionCartographics.height. How can this be done?
P.s. You also need the primitive to not follow the camera

Hi @Victor_Johnson,

Does this need to be done with the Primitive API, or would it be possible to use the higher-level Entity API?

I think he has the same problem as me. To display a large number of primitives, you need to scale on the shader side to avoid drawdown. I am also looking for such a solution.

I need to use the primitives specifically