How to position objects lower down by default

General discussion about Celestia that doesn't fit into other forums.
Topic author
DiscoveryDome
Posts: 4
Joined: 28.12.2008
With us: 15 years 11 months

How to position objects lower down by default

Post #1by DiscoveryDome » 28.12.2008, 10:16

Hi everyone

I'm using Celestia in a mobile planetarium, and as you can imagine, the centre of the computer screen for you is the zenith (top) of the dome for me ie. when a planet appears, it is positioned by default at the very top of the dome for me (and at the centre of the computer screen for you).

Is there a way perhaps to change the default settings in Celestia to have objects positioned lower down on the screen? ie. for me that would mean lower down at the front of the dome, allowing my audience to enjoy the view without hurting their necks? :-)

Your help would be greatly appreciated (not only by me, but by the growing digital planetarium community using Celestia too)!

Thank you in advance

Mario

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Re: How to position objects lower down by default

Post #2by Chuft-Captain » 28.12.2008, 14:12

Welcome Mario,

The following procedure does not change the default behaviour, but will allow you to reposition objects with the press of a key.

1. Create a file with your favorite text editor (wordpad will do).
2. Paste the following text into it:

Code: Select all

-- Title: Move object lower (for Planetarium use)
-- ... Beginning of script

rad = -0.1
steps = 30
xOn   =celestia:newvector(1,0,0)
yOn   =celestia:newvector(0,1,0)
zOn   =celestia:newvector(0,0,1)
rOn   =xOn

      obs   = celestia:getobserver()

         angle= math.asin(rad)                     -- in [-pi/2;pi/2]
         -- calc step-quaternion
         quat=celestia:newrotation(xOn, angle/steps)
         for i=1,steps do
             obs:rotate(quat)
             wait(0)
         end--for


-- End of script...

3. Save it with the name "down.celx" to your C:\Program Files\Celestia\scripts folder.

4. In the C:\Program Files\Celestia folder, you will find a file called celestia.cfg. Open this with your editor and change:

Code: Select all

DemoScript  "demo.cel"
to:

Code: Select all

#DemoScript  "demo.cel"
DemoScript  "C:/Program Files/Celestia/scripts/down.celx"


Now, each time you press the "D" (demo) key, the script will rotate the viewpoint to bring your objects down from the zenith by a specified amount. (ie. closer to the bottom edge of the screen.)
You can adjust the amount of movement to your specific requirements by adjusting the value of the "rad" variable.

NOTE: This redefines the "D" key to run this script instead of the demo script, so you will no longer be able to run the default Celestia demo.
If this is important to you, then skip step 4, and run the script from the script menu instead.

Hope this is helpful
CC
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Topic author
DiscoveryDome
Posts: 4
Joined: 28.12.2008
With us: 15 years 11 months

Re: How to position objects lower down by default

Post #3by DiscoveryDome » 04.01.2009, 13:35

Thank you very much for this, I will attempt to implement it soon. I hope to use your code to reposition each planet as it appears. Thanks again.

Topic author
DiscoveryDome
Posts: 4
Joined: 28.12.2008
With us: 15 years 11 months

Re: How to position objects lower down by default

Post #4by DiscoveryDome » 06.01.2009, 14:07

Problem.

I've just tried to add this suggested script (or elements of it) into the Demo script (to cause the planets to appear lower down on the screen by default), and unfortunately failed.

You see, I need the "D" key to run the demo, so I would rather add a few lines of code to the Demo script (or other scripts) to make this adjustment happen automatically.

Is it possible to do so?

Oh yes, and I'm using version 1.4.1.

Thanks very much!


Mario

Avatar
Adirondack M
Posts: 528
Joined: 01.03.2004
With us: 20 years 8 months

Re: How to position objects lower down by default

Post #5by Adirondack » 08.01.2009, 11:58

DiscoveryDome wrote:I've just tried to add this suggested script (or elements of it) into the Demo script (to cause the planets to appear lower down on the screen by default), and unfortunately failed.
Mario,
that doesn't work! You can't add CELX code to a CEL script!

Adirondack
We all live under the same sky, but we do not have the same horizon. (K. Adenauer)
The horizon of some people is a circle with the radius zero - and they call it their point of view. (A. Einstein)

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

Re: How to position objects lower down by default

Post #6by John Van Vliet » 08.01.2009, 21:21

--- edit ---
Last edited by John Van Vliet on 25.10.2013, 03:02, edited 1 time in total.

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 1 month

Re: How to position objects lower down by default

Post #7by BobHegwood » 08.01.2009, 23:00

john Van Vliet wrote:the differences from 1.4 to 1.6 is like windows 98 to vista

Please don't use that example. Very baaaaaad comparison. :roll: :wink:
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Re: How to position objects lower down by default

Post #8by Chuft-Captain » 09.01.2009, 00:50

Adirondack wrote:
DiscoveryDome wrote:I've just tried to add this suggested script (or elements of it) into the Demo script (to cause the planets to appear lower down on the screen by default), and unfortunately failed.
Mario,
that doesn't work! You can't add CELX code to a CEL script!

Adirondack
Mario,
it is possible to embed a CEL script within a CELX script (the reverse of what you tried to do) , using a "celscript" command, however it is somewhat less than straightforward and probably wouldn't achieve what you want anyway.
I think your best chance is to make a CELX version of the existing demo.CEL. This also, will not be easy as you'll need to get up to speed on both CEL and CELX scripting, but this would allow you to make use of my CELX code for repositioning the viewpoint. (Although by the time you've mastered scripting well enough to do that re-write, I suspect you will have come up with a better way of doing that anyway. :wink: )
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

Re: How to position objects lower down by default

Post #9by John Van Vliet » 09.01.2009, 04:35

--- edit ---


Return to “Celestia Users”