Using refmarktable

All about writing scripts for Celestia in Lua and the .cel system
Topic author
SME
Posts: 2
Joined: 28.10.2008
With us: 16 years 1 month

Using refmarktable

Post #1by SME » 09.12.2009, 01:19

I've created the following script of the moon orbiting the earth, with an arrow pointed from the moon to the sun and another arrow pointing at the earth.

Code: Select all

CEL([[{seturl {url "cel://Follow/Sol:Earth/2009-12-09T01:10:12.12924?x=ACHVcPwO5xk&y=AMwjfa0pFGg&z=oJD+b4ze8wI&ow=0.146371&ox=0.281612&oy=0.671824&oz=0.66927&fov=25&ts=1&ltd=0&p=0&rf=268211&lm=0&tsrc=0&ver=3" }}]])
celestia:setambient(0.0)
celestia:settimescale(180000)
refmarktable={}
refmarktable.type="sun direction"
refmarktable.size = 250000
moon=celestia:find("Sol/Earth/Moon")
moon:addreferencemark(refmarktable)
wait(11.0)
refmarktable.type="body to body direction"
earth=celestia:find("Sol/Earth")
refmarktable.target=earth
refmarktable.size = 250000
moon:addreferencemark(refmarktable)
celestia:settimescale(180000)
wait(14.0)
-- refmarktable.type="sun direction"
-- moon:removereferencemark(refmarktable.type)
-- refmarktable.type="body to body direction"
-- moon:removereferencemark(refmarktable.type)


The trouble is the arrows keep disappearing and reappearing as the moon orbits the earth.

Does anyone have a solution for this?

Sean

Avatar
Marco Klunder
Posts: 181
Joined: 20.02.2008
Age: 62
With us: 16 years 9 months
Location: The Netherlands

Re: Using refmarktable

Post #2by Marco Klunder » 12.12.2009, 10:37

Indeed strange rendering behaviour of the referencemarkers.
As far as I can detect it has something to do with the combination of the size of the referencemarkers and the distance to the object.
When you come closer to the Moon, the referencemarkers will stay rendered and that is even the case when you get further away from the Moon. So indeed, there is a region where the rendering of this size referencemarkers is alternately rendered and not rendered.

This only seems a circumvention to me. It's not the solution for the real problem.

Marco
Marco Klunder
email: marco.klunder@xs4all.nl
Windows10 PD 3.0 GHz, 2 GB of RAM, Nvidia GeForce 6700 XL
Celestia161 / SVN + Lua Edu Tools v1.2 Beta9, Celestia160-ED and Celestia1621


Return to “Scripting”