CELX command to display an arrow?
CELX command to display an arrow?
Hello,
I would like to add in my CELX script a command allowing to display an arrow from an object pointing the sun or the magnetic field direction or even to display a frame.
Do you know the command? Is it possible to call directly the functions defined in the celestia source? RenderSunDirectionArrow? or RenderAxisArrows?
I would prefer not to use the mouse command in order to add an automatic sequence of displays...
I have searched in all available tutorials and I don't find anything.
Hope you could help me.
Thanks.
Dams.
I would like to add in my CELX script a command allowing to display an arrow from an object pointing the sun or the magnetic field direction or even to display a frame.
Do you know the command? Is it possible to call directly the functions defined in the celestia source? RenderSunDirectionArrow? or RenderAxisArrows?
I would prefer not to use the mouse command in order to add an automatic sequence of displays...
I have searched in all available tutorials and I don't find anything.
Hope you could help me.
Thanks.
Dams.
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: CELX command to display an arrow?
You can add your reference mark using, e.g.:
Then use this line to remove it:
Here you'll find more about how to use reference marks in celx:
http://en.wikibooks.org/wiki/Celestia/C ... erencemark
Code: Select all
sel = celestia:getselection()
sel:addreferencemark{type = "sun direction", size = 5000, color = "yellow", tag = "sun_dir"}
Then use this line to remove it:
Code: Select all
sel:removereferencemark("sun_dir")
Here you'll find more about how to use reference marks in celx:
http://en.wikibooks.org/wiki/Celestia/C ... erencemark
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 10 months
- Location: Seattle, Washington, USA
Re: CELX command to display an arrow?
Note that the reference mark functions are not present in version 1.5.1 and earlier. You'll need to have a SVN build of version of 1.6.0 (search the forum for the link) in order to enable reference marks via script.
--Chris
--Chris
Re: CELX command to display an arrow?
Thanks Chris and Vincent.
I have just a last question for you Chris... I am not sure to understand what you mean.
If I am using a version 1.5.0 (for example), I cannot use the reference marks functions. Right?
So, you explain that I need a SVN build of version 1.6.0... what is a SVN build of version 1.6.0 ?
Thanks.
Dams.
I have just a last question for you Chris... I am not sure to understand what you mean.
If I am using a version 1.5.0 (for example), I cannot use the reference marks functions. Right?
So, you explain that I need a SVN build of version 1.6.0... what is a SVN build of version 1.6.0 ?
Thanks.
Dams.
Re: CELX command to display an arrow?
Ok ! sorry for this last question...
It's obvious. I have found two executables WIN32 on the website of Cartrite and Phoenix.
I have just to replace the celestia.exe file and it should work.
Do you know if a lot of things are changing with this version?
- deprecated functions?
- CELX commands difference?
- ...
Dams.
It's obvious. I have found two executables WIN32 on the website of Cartrite and Phoenix.
I have just to replace the celestia.exe file and it should work.
Do you know if a lot of things are changing with this version?
- deprecated functions?
- CELX commands difference?
- ...
Dams.
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 10 months
- Location: Seattle, Washington, USA
Re: CELX command to display an arrow?
dams2008 wrote:Ok ! sorry for this last question...
It's obvious. I have found two executables WIN32 on the website of Cartrite and Phoenix.
I have just to replace the celestia.exe file and it should work.
Do you know if a lot of things are changing with this version?
- deprecated functions?
- CELX commands difference?
- ...
Many things are changing. There are no newly deprecated functions, however. The changes are mostly feature additions and bug fixes. There's no list of celx differences yet, but new celx functions are flagged with a green '1.6.0' in the reference on the WikiBook:
http://en.wikibooks.org/wiki/Celestia/C ... ua_Methods
If you're creating add-ons, you might also be interested in new features for add-on creators:
http://en.wikibooks.org/wiki/Celestia/160Files
--Chris
Re: CELX command to display an arrow?
OK !
So, I think I have a problem with the install of the SVN build of version 1.6.0.
I have downloaded the r4407 (from Cartrite's website) and I do the followings steps:
- copy the r4407_celestia.exe in the Celestia directory.
- run the r4407_celestia.exe
- run my script (draw a satellite in orbit around earth)
=> but nothing is drawn excepted the earth!! The satellite object is not recognized if I try to go to the object manually.
- with the original executable, it works perfectly.
Do you have an idea? If there something else to modify to install in order to use the version 1.6.0?
Dams.
So, I think I have a problem with the install of the SVN build of version 1.6.0.
I have downloaded the r4407 (from Cartrite's website) and I do the followings steps:
- copy the r4407_celestia.exe in the Celestia directory.
- run the r4407_celestia.exe
- run my script (draw a satellite in orbit around earth)
=> but nothing is drawn excepted the earth!! The satellite object is not recognized if I try to go to the object manually.
- with the original executable, it works perfectly.
Do you have an idea? If there something else to modify to install in order to use the version 1.6.0?
Dams.
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 10 months
- Location: Seattle, Washington, USA
Re: CELX command to display an arrow?
dams2008 wrote:OK !
So, I think I have a problem with the install of the SVN build of version 1.6.0.
I have downloaded the r4407 (from Cartrite's website) and I do the followings steps:
- copy the r4407_celestia.exe in the Celestia directory.
- run the r4407_celestia.exe
- run my script (draw a satellite in orbit around earth)
=> but nothing is drawn excepted the earth!! The satellite object is not recognized if I try to go to the object manually.
- with the original executable, it works perfectly.
Do you have an idea? If there something else to modify to install in order to use the version 1.6.0?
Is there an error message in the console? (You can enable it by pressing the tilde (~) key; use the up and down arrows to scroll.) Can you post the part of the script that draws the satellite? Is there a custom .ssc file involved as well?
--Chris
Re: CELX command to display an arrow?
I have enabled the error message and I notice the following errors before running my celx script:
Loaded 10937 deep space objects
Error in the file .ssc (line 92): object 'TYC 3466-0819-1' .. not found
Error in the file .ssc (line 92): bad alternative surface
...
Body frame for GB2 is needed too deep (probably circular)
...
After running my script, nothing else is appearing.
The view is modified and correspond to the right view but without the satellite...
I have added alternative surface (new .ssc) for earth. Maybe it causes an issue...
Loaded 10937 deep space objects
Error in the file .ssc (line 92): object 'TYC 3466-0819-1' .. not found
Error in the file .ssc (line 92): bad alternative surface
...
Body frame for GB2 is needed too deep (probably circular)
...
After running my script, nothing else is appearing.
The view is modified and correspond to the right view but without the satellite...
I have added alternative surface (new .ssc) for earth. Maybe it causes an issue...
Code: Select all
Here is the *.ssc script and *.celx script
------------------------ SSC -----------------
"GB2" "Sol/Earth"
{
Class "moon"
Mesh "gb2.3ds"
Radius 800
Beginning 2454993.782004444
OrbitFrame { EquatorJ2000 { Center "Sol/Earth" }}
BodyFrame { BodyFixed { Center "Sol/Earth/GB2" }}
SampledOrbit "gb2.xyz"
SampledOrientation "gb2.q"
Albedo 0.10
Orientation [90 1 0 0]
Ending 2454993.823671111
}
---------------------- CELX --------------------
while celestia:gettime()< 2454993.782004444 do celestia:flash(" Debut Script GB2 ",1) wait(0) end
-- Do not label the following objects
celestia:hidelabel("planets","moons","spacecraft","asteroids","constellations")
celestia:hidelabel("stars","galaxies","moon")
-- Label the following objects
-- celestia:showlabel("moon")
-- Do not render the following objects
celestia:setrenderflags{asteroids = flase,grid=flase,constellations=false}
-- Render the following objects
celestia:setrenderflags{atmosphere=true,stars=true}
-- Do not render the following objects
celestia:setlabelflags{planets = flase,spacecraft=false}
-- Set Time Rate
celestia:settimescale(2.0)
tt=celestia:find("Sol/Earth")
gb2=celestia:find("Sol/Earth/GB2")
celestia:unmark(tt)
celestia:unmark(gb2)
celestia:select(gb2)
obs = celestia:getobserver()
obs:lock(tt)
obs:center(gb2)
obs:track(gb2)
obs:chase(gb2)
obs:gotodistance(gb2,6000,5)
obs:lock(tt)
while celestia:gettime()< 2454993.823671111 do celestia:flash(" Fin Script GB2 ",1) wait(0) end
---------------- SSC for alternative surface ---------------
AltSurface "earth_real_color" "Sol/Earth"
{
Texture "earth_real_color.*"
}
AltSurface "earth_high_res" "Sol/Earth"
{
Texture "earth_high_res.*"
}
------------------------------------------------------------------
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 10 months
- Location: Seattle, Washington, USA
Re: CELX command to display an arrow?
dams2008 wrote:I have enabled the error message and I notice the following errors before running my celx script:
Loaded 10937 deep space objects
Error in the file .ssc (line 92): object 'TYC 3466-0819-1' .. not found
Error in the file .ssc (line 92): bad alternative surface
...
Body frame for GB2 is needed too deep (probably circular)
It sounds like the problem is with your definition for GB2 in the ssc file. Could you cut and paste that into a forum post?
--Chris
Re: CELX command to display an arrow?
[/quote]
It sounds like the problem is with your definition for GB2 in the ssc file. Could you cut and paste that into a forum post?
--Chris[/quote]
Do you mean in a new post or in this one?
Otherwise, the gb2.ssc file is already pasted in the previous message. I paste it again hereafter.
------------------------ SSC -----------------
"GB2" "Sol/Earth"
{
Class "moon"
Mesh "gb2.3ds"
Radius 800
Beginning 2454993.782004444
OrbitFrame { EquatorJ2000 { Center "Sol/Earth" }}
BodyFrame { BodyFixed { Center "Sol/Earth/GB2" }}
SampledOrbit "gb2.xyz"
SampledOrientation "gb2.q"
Albedo 0.10
Orientation [90 1 0 0]
Ending 2454993.823671111
}
It sounds like the problem is with your definition for GB2 in the ssc file. Could you cut and paste that into a forum post?
--Chris[/quote]
Do you mean in a new post or in this one?
Otherwise, the gb2.ssc file is already pasted in the previous message. I paste it again hereafter.
------------------------ SSC -----------------
"GB2" "Sol/Earth"
{
Class "moon"
Mesh "gb2.3ds"
Radius 800
Beginning 2454993.782004444
OrbitFrame { EquatorJ2000 { Center "Sol/Earth" }}
BodyFrame { BodyFixed { Center "Sol/Earth/GB2" }}
SampledOrbit "gb2.xyz"
SampledOrientation "gb2.q"
Albedo 0.10
Orientation [90 1 0 0]
Ending 2454993.823671111
}
Re: CELX command to display an arrow?
Unfortunately, an object's BodyFrame cannot be defined relative to itself. Orbits and Rotations always are relative to other objects.
GB2 needs to be deleted from its BodyFrame declaration.
BodyFrame { BodyFixed { Center "Sol/Earth/GB2" }}
could be
BodyFrame { BodyFixed { Center "Sol/Earth" }}
or it could specify some other previously defined body.
GB2 needs to be deleted from its BodyFrame declaration.
BodyFrame { BodyFixed { Center "Sol/Earth/GB2" }}
could be
BodyFrame { BodyFixed { Center "Sol/Earth" }}
or it could specify some other previously defined body.
Selden
Re: CELX command to display an arrow?
Thanks for your answer. It works perfectly now.
I have another question.
I know (thanks to previous messages) how to display the sun direction, the body frame,... but I do not know how to display an arrow representing for instance the earth magnetic field direction or total angular momentum... it's not the same thing than drawing an arrow representing the direction from an object to another object.
Do I have to create a new frame and display one axis of this new frame?
Dams.
I have another question.
I know (thanks to previous messages) how to display the sun direction, the body frame,... but I do not know how to display an arrow representing for instance the earth magnetic field direction or total angular momentum... it's not the same thing than drawing an arrow representing the direction from an object to another object.
Do I have to create a new frame and display one axis of this new frame?
Dams.
Re: CELX command to display an arrow?
Dams,
Magnetic fields are not designed into Celestia.
Defining an appropriate body and displaying that body's axis does sound like a reasonable approach.
Magnetic fields are not designed into Celestia.
Defining an appropriate body and displaying that body's axis does sound like a reasonable approach.
Selden
Re: CELX command to display an arrow?
Ok I understand but I do not know how to proceed...
Would it be possible to have a simple explanation?
Thanks.
Dams.
Would it be possible to have a simple explanation?
Thanks.
Dams.
Re: CELX command to display an arrow?
I think Cham's "Magnetic Earth" Addon might be a good place to start. It's available on the MotherLode at
http://www.celestiamotherlode.net/catal ... on_id=1016
http://www.celestiamotherlode.net/catal ... on_id=1016
Selden