Textures in SVN's

General discussion about Celestia that doesn't fit into other forums.
Guckytos
Posts: 439
Joined: 01.06.2004
With us: 20 years 5 months
Location: Germany

Re: Textures in SVN's

Post #21by Guckytos » 15.03.2009, 18:31

fsgregs wrote:
what about a good description of what the key does? Where do you get this from?

A description with examples of what every key in Celestia does and cel/URL's that a reader can click on to see the key's effect, is already in the Users Guide, which is currently available via hyperlink from the main Celestia website and the Motherlode.

A shorter version of it focused just on the keys, could be written in or converted to PDF or HTML and included with the default distribution, with access to it as a link in the Help menu.

If the development team felt that would be the best idea, I would be happy to work on it.

Frank
Hmm, Frank I think there is a misunderstanding here.

What I was referring to was the automated generation of the keyboard shortcuts as a readme, that bdm was talking about before.

My question was, where would the automated generator get the good information for a newly introduced shortcut from?

And what you are proposing is already being done here http://shatters.net/forum/viewtopic.php?f=2&t=12930, so that would be double work, what you are proposing, I think. I only have not very much time to finish it at the moment. So I think it will have to wait for 1.6.1 and also because the translators would need time to translate it.

Best regards,

Guckytos

mjoubert
Posts: 58
Joined: 02.04.2007
With us: 17 years 7 months

Re: Textures in SVN's

Post #22by mjoubert » 25.03.2009, 17:22

Vincent wrote:Christophe, Martin,

An alternative is to add a celx function that sets the textures resolution, such as:

Code: Select all

celestia:settexturesresolution("medium")

This way, you will be able to map this function to any key (including r/R) using your start.celx script.

Does this sound reasonable?

Vincent,

I'm now using the command settexturesresolution. I think it's useful to select the resolution in a startup script.

In the same way, I'd like to be able to select an alternative surface (i.e. BMNG) in a startup script with a command like

Code: Select all

setalternativesurface {  object "/sol/earth" surface "BMNG 128K" }


Does it already exist ? Is it possible to add it ?

Maybe I can do it by my own if you want to.

Thanks,

Mathieu

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Textures in SVN's

Post #23by chris » 25.03.2009, 17:37

Mathieu,

This function exists already: observer:setsurface(). The fact that it's a method of observer is probably why you didn't notice it immediately:

http://en.wikibooks.org/wiki/Celestia/C ... setsurface

You'd use it like this:

Code: Select all

celestia:getobserver():setsurface("BMNG 128K")


Note that you can't set the surface per object. In the above example, any object without a surface named 'BMNG 128K' would just appear with its default texture.

--Chris

mjoubert
Posts: 58
Joined: 02.04.2007
With us: 17 years 7 months

Re: Textures in SVN's

Post #24by mjoubert » 26.03.2009, 13:10

Thank you Chris,

(difficult to answer faster than you did !)

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Re: Textures in SVN's

Post #25by Vincent » 26.03.2009, 16:36

The setttextureresolution function is now available in the 1.6 development version
both for celx and cel scripting. It takes a number argument in celx (0 | 1 | 2)
and a string argument in cel ("low" | "medium" | "high"). We opted for a number
argument in celx in order to allow the use of code like:

Code: Select all

celestia:settextureresolution(celestia:gettextureresolution() + 1)


CELX example:

Code: Select all

-- Title: change texture resolution using R key

function changeTextureRes()
    texRes = celestia:gettextureresolution()
    if texRes == 2 then
        texRes = 0
    else
        texRes = texRes + 1
    end
    celestia:settextureresolution(texRes)
end

keyhandlers =
{
    R = changeTextureRes
}

function handlekey(k)
    handler = keyhandlers[k.char]
    if (handler ~= nil) then
        handler()
        return true
    else
        return false
    end
end

celestia:registereventhandler("key", handlekey)


CEL example:

Code: Select all

{
settextureresolution {resolution "low"}
wait {duration 3}

settextureresolution {resolution "medium"}
wait {duration 3}

settextureresolution {resolution "high"}
wait {duration 3}
}
@+
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

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Re: Textures in SVN's

Post #26by ElChristou » 26.03.2009, 17:24

Tx Vince!
I'll update my source and test out later today.
Image

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Re: Textures in SVN's

Post #27by ANDREA » 26.03.2009, 19:02

Vincent wrote:The setttextureresolution function is now available in the 1.6 development version both for celx and cel scripting.
Thanks a lot, Vincent, very appreciated by all poor cel users. :wink:
Bye

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

mjoubert
Posts: 58
Joined: 02.04.2007
With us: 17 years 7 months

Re: Textures in SVN's

Post #28by mjoubert » 27.03.2009, 09:17

Works as expected in a Tcl script that generated a .cel startup script.

Code: Select all

   # D?finition du niveau de textures
   if { $texturesLevel == "high" } {
      puts $id "   settextureresolution { resolution \"high\" }"
      puts $id "   setsurface { name \"128K Blue Marble Next Generation\"}"
   } else {
      puts $id "   settextureresolution { resolution \"medium\" }"
      puts $id "   setsurface { name \"Normal\"}"
   }

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Re: Textures in SVN's

Post #29by ElChristou » 29.03.2009, 12:27

Oops, I forgot to post, sorry... All is ok, many tx for this script feature!
Image

bdm
Posts: 461
Joined: 22.07.2005
With us: 19 years 4 months
Location: Australia

Re: Textures in SVN's

Post #30by bdm » 01.04.2009, 07:47

Guckytos wrote:
bdm wrote:
Chuft-Captain wrote:BTW. The dropdown keyboard shortcuts (Help menu) is now out of date.
Is it possible to build the Help menu in code from the same resources that the application uses for the shortcuts themselves? That way, if the keys change, the Help menu is updated automagically.

How would you do that? I mean, you would get the keys, but what about a good description of what the key does? Where do you get this from?
If the code had an appropriate structure to store this information, it can be provided as a part of the structure by the developer.

Suppose the structure had the following definitions:

Code: Select all

ShortcutKey: Keytype;
Description: string;
BoundFunction: celfunction;

Then the application would use the ShortcutKey to execute the BoundFunction, and the part of the application that builds the Help menu would convert the ShortcutKey to human-readable text with a function, and then append the Description. If the ShortcutKey changes, the Help text is also changed at the same time. This approach eliminates bugs caused by the Help text and the code getting out of sync.


Return to “Celestia Users”