You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to convert ellipse class to arc/pie class.
override fun assembleGeometry(rc: RenderContext) {
super.assembleGeometry(rc)
val startRadians = Math.toRadians(startAngle)
val endRadians = Math.toRadians(endAngle)
val totalAngle = if (endAngle >= startAngle) {
endRadians - startRadians
} else {
(endRadians + 2 * Math.PI) - startRadians
}
val stepCount = (totalAngle / Math.toRadians(1.0)).toInt()
val angleStep = totalAngle / stepCount
val vertexList = mutableListOf<Float>()
vertexList.add(0f)
vertexList.add(0f)
for (i in 0..stepCount) {
val currentAngle = startRadians + i * angleStep
val x = ((distanceInMeters / GlobeObject.getWorldWindow().engine.globe.equatorialRadius*70) * Math.cos(currentAngle)).toFloat()
val y = ((distanceInMeters / GlobeObject.getWorldWindow().engine.globe.equatorialRadius*70) * Math.sin(currentAngle)).toFloat()
vertexList.add(x)
vertexList.add(y)
}
if (vertexArray.size != vertexList.size) {
vertexArray = FloatArray(vertexList.size)
}
for (i in vertexList.indices) {
vertexArray[i] = vertexList[i]
}
}
The text was updated successfully, but these errors were encountered:
Is there any way to convert ellipse class to arc/pie class.
The text was updated successfully, but these errors were encountered: