How can I do it?

All about writing scripts for Celestia in Lua and the .cel system
Topic author
ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 8 months
Location: Rome, ITALY

How can I do it?

Post #1by ANDREA » 04.03.2004, 21:29

This topic is for the .cel scripts experts. :D
I made a lot of changes to Bob Hegwood's very nice MarsTour, and one of these is the view of Spirit Rover in the 3d Gusev Crater. :roll:
But though my many tries I have not been able to write the right commands in order to obtain this:
Image. :oops:
I mean, the rotation to East, looking at the same time to Spirit, staying just a little higher than the Rover, in order to see the Sun reflection on the panels as it rises from the horizon. :wink:
Someone will help me, please? :roll:
Appreciated. :D
By soon

Andrea 8)
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 6 months
Location: Colorado, USA (7000 ft)

Post #2by don » 05.03.2004, 01:38

Hi Andrea,

I'm not sure if Celestia is capable of a view quite that close to a surface, without making your graphics card go crazy (lots of flashing triangles). Also, Celestia does not show relief (like mountains), so they would not be in the picture either.

I would start by using synchronous orbit, so the viewer position remains relative to the surface.

Then, use gotolonglat to obtain the proper longitude and latitude position.

Then, adjust the distance (in the gotolonglat command) as close to the surface as you can, and not have the graphics card go crazy.

Then, try each of the different "up" values:
[1 0 0]
[0 1 0]
[0 0 1]
To see which one comes closest you the direction you want to be viewing.

Then, it's time to experiment. You might be able to use rotate, orbit, or setorientation to get the view just right. I'm not sure which will work for this case, as I've not done it myself.

The *easiest* way to do this would be to use the keyboard controls to get the view you want and then save it as a bookmark and/or cel://URL and then try to use the data that either of these provides within the script commands (setorientation, setposition, or seturl).

Hope this helps!

-Don G.

Bob Hegwood
Posts: 1048
Joined: 19.10.2003
With us: 21 years 3 months
Location: Germantown, Ohio - USA

Post #3by Bob Hegwood » 05.03.2004, 04:39

Andrea,

What Don said... :lol:

Take care, Bob
Bob Hegwood
Windows XP-SP2, 256Meg 1024x768 Resolution
Intel Celeron 1400 MHz CPU
Intel 82815 Graphics Controller
OpenGL Version: 1.1.2 - Build 4.13.01.3196
Celestia 1.4.0 Pre6 FT1

Topic author
ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 8 months
Location: Rome, ITALY

Post #4by ANDREA » 05.03.2004, 13:38

don wrote:Hi Andrea, I'm not sure if Celestia is capable of a view quite that close to a surface, without making your graphics card go crazy (lots of flashing triangles). Also, Celestia does not show relief (like mountains), so they would not be in the picture either.
Don, and Bob too, Celestia can go so close, provided you have a powerful graphyc card. 8O Moreover I'm using the wonderful Jestr's Gusev 3D crater, that you can see in this topic :wink:
http://www.celestiaproject.net/forum/viewtopic.php?t=4387, and here are some shots: 8O

Image

Image

Image

Image
Actually I'm in this situation, unable to obtain a script that brings me to the following one: :(

Image
Obviously I'll put the time at the Martian sunrise time. :wink:

don wrote:I would start by using synchronous orbit, so the viewer position remains relative to the surface. Then, use gotolonglat to obtain the proper longitude and latitude position. Then, adjust the distance (in the gotolonglat command) as close to the surface as you can, and not have the graphics card go crazy.
I'm just at this point, and my problems start here.
don wrote:Then, try each of the different "up" values:
[1 0 0]
[0 1 0]
[0 0 1]
To see which one comes closest you the direction you want to be viewing.
Then, it's time to experiment. You might be able to use rotate, orbit, or setorientation to get the view just right. I'm not sure which will work for this case, as I've not done it myself. .
Yes, I'll try this, but I supposed that the .cel commands could be a bit more user friendly. :cry: E.g., why not a "look East" or something of this kind (celestia knows exactly where the Spirit Rover is, and equally knows exactly where is the East), and at the same time perhaps it could be possible to lock Spirit and "East", why not? 8O
don wrote:The *easiest* way to do this would be to use the keyboard controls to get the view you want and then save it as a bookmark and/or cel://URL and then try to use the data that either of these provides within the script commands (setorientation, setposition, or seturl). Hope this helps!.

I will try, even if I'm not so used with keybord controls, I mainly use the mouse to obtain the position I want. :oops:
Thank you very much for your prompt and exhaustive reply. :D
I'll inform you on results. 8)
By soon

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO


Return to “Scripting”