I am Zhang Han from Guangzhou, Guangdong, China,I encountered a problem that confuses me very much,hope to get the designer’s answer。My English is not very good, so please use the translation software directly, please forgive me。
I am learning Primitive recently,i want to make the rotation meet my expectations, so I will first put the object to be added in Cartesian3(0,0,0), and then use Cesium.Matrix4.fromTranslationQuaternionRotationScale to move the object to the position I want and rotate me The angle needed.
When drawing other shapes such as Cylinder, it is normal, but when I draw line segments, I get an error.
I looked at the source code and it was this place that caused it.
Ellipsoid. CartesianToCartographic cannot contain Cartesian3 using (0, 0,0), will be undefined, and this is the original design or a bug?
I think I can make a submission for this problem and fix the problem in this case。
You can reproduce this problem very conveniently here https://sandcastle.cesium.com/?src=Polyline.html
Just change a value in positions to Cesium.Cartesian3.ZERO or new Cesium.Cartesian3(0,0,0)
thank you for your reply
It may be that the description of my problem is not clear. I understand that Cartesian3(0,0,0) cannot be converted to Cartographic. The problem now is that this line will crash if it passes Cartesian3(0,0,0), but we know only It takes two points to draw a line. Is it really necessary to convert each Cartesian3 to Cartographic and then calculate it?
Maybe this Cartesian3(0,0,0) needs special treatment?
I noticed that the problem here is mainly to calculate extractHeights. Maybe it can make it have a value of 0 or undefined at the point containing Cartesian3(0,0,0)?
Chinese version:
我注意到这里出问题的地方主要是为了计算extractHeights,也许可以让它在包含Cartesian3(0,0,0)的点处的extractHeights值为0或者undefined?