I update it like this now, but it doesn’t look ideal.
this.viewer.scene.preRender.addEventListener(() => {
this.pointPrimitives._pointPrimitives.forEach(point => {
const time = this.viewer.clock.currentTime
const position = point.SampledPosition.getValue(time)
point.position = position
})
}
At first, I used the sampling position of entity to update the point position, but the performance of loading a large number of entities decreased sharply
I see this update method on this website, But I don’t know how to achieve it
I finally used the wasm module to update the position of the point, but it is used to bind the orbit data and calculate the coordinates of the satellite. This module is written in other languages and then compiled into a wasm module that can run in JS
In addition, I found that wasmModule.propagate may take too much time when many points, what is your solution? now I use registerEntity for every one satellite, any other methods? Thanks.
Thanks for your reply. Are you using webpack? I’m using vue cli 5 and there are some problems with the spg.js file importing.Do you have this situation? May it’s caused by this?
I have got this code but it can’t work properly. Can you help me point out the problem?It’s just about six 6000 satellites, but may make browser crashed. So sad.
this.viewer.scene.preRender.addEventListener((e, t) => {
const date = Cesium.JulianDate.toDate(t).getTime()
const offset = this.wasmModule.propagate(date, !0)
const positions = new Float64Array(this.wasmModule.HEAP8.buffer, offset, 3 * this.allSatellite.size)
let i = 0
this.allSatellite.forEach(point => {
Cesium.Cartesian3.fromArray(positions, 3 * i, satellitePosition)
point.position = satellitePosition
i++
})
})
This is how I update the coordinates. I updated more than 20000 points, and the scene is still very smooth. Is it because you update the frame incorrectly?
Oh, god, what a silly mistake! I don’t know when did I change this line code but … Thanks for your help. Very helpful for me , really appreciate for that !