Celx Simple geometry creation

All about writing scripts for Celestia in Lua and the .cel system
Topic author
andrtose
Posts: 2
Joined: 22.04.2009
With us: 15 years 7 months

Celx Simple geometry creation

Post #1by andrtose » 22.04.2009, 12:17

Dear All,

I'm new in Celestia scripting and I'd like to know if the version 1.5.1 or 1.6 have the possibility to generate a simple geometry (e.g. a rectangle rendered in a color) or not, I found this :

viewtopic.php?f=2&t=11953&p=99445&hilit=satellite+colors#p99445

where is said from the version 1.5.0 there is the possibility to create simple geometry via celx scripting (it is correct or I'm wrong?), but I cannot find documentation about the new functonalities.

In alternative I will find useful only to set the color of a cmod object via script, is it possible?

Thanks in advantage.

Regards,
Andrea

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

Re: Celx Simple geometry creation

Post #2by Chuft-Captain » 22.04.2009, 14:36

It has recently become possible to get/set the color of cms meshes, but not yet (as far as I'm aware) cmod or 3ds meshes.
See here: http://shatters.net/forum/viewtopic.php?f=2&t=12482

Celestia meshes are loaded at startup.

I don't know what your programming expertise is, but theoretically a clever coder might be able to extend Celestia's code to generate a geometry directly in memory, but this will require an intimate knowledge of Celestia's core code, which is knowledge I certainly don't have.

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

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Celx Simple geometry creation

Post #3by selden » 22.04.2009, 15:56

andrtose,

What statement in the description of v1.5 did you interpret as allowing dynamic generation of models?
I don't recall seeing that, and it's certainly something I'd like to try!

You can change the radius of an object at runtime, and in v1.6 you can change whether or not a object is visible, but I don't think those options are what you want.

So far as I know, you can't change colors at runtime, either :(

However, you can simulate both of those things by predefining several different objects and making them visible or invisible.
Selden

Topic author
andrtose
Posts: 2
Joined: 22.04.2009
With us: 15 years 7 months

Re: Celx Simple geometry creation

Post #4by andrtose » 23.04.2009, 06:52

Thank you to all for the quick reply!

selden wrote:
What statement in the description of v1.5 did you interpret as allowing dynamic generation of models?
I don't recall seeing that, and it's certainly something I'd like to try!

Probably I misunderstood this :

* CELX Scripting improvements:
- OpenGL drawing commands allow scripts to display custom graphics on screen.

I interprete it as the possibility to create geometry shapes, are you saying that I can change the radius of an object and also the visiblility of an object?

selden wrote:So far as I know, you can't change colors at runtime, either :(

However, you can simulate both of those things by predefining several different objects and making them visible or invisible.

Thanks for the suggestion, I'll try this and also to modify the source code but it is matter of the other forum.

Regards,
Andrea

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Celx Simple geometry creation

Post #5by selden » 23.04.2009, 10:46

andrtose wrote:* CELX Scripting improvements:
- OpenGL drawing commands allow scripts to display custom graphics on screen.
Several calls to OpenGL are available which are intended only for drawing lines and loading pictures "in the plane of the screen". Unfortunately, I don't think they are very well documented. Vincent can tell you more. He uses them in the Lua Edu Addon. See http://www.celestiaproject.net/forum/viewtopic ... 11&t=13162

I interprete it as the possibility to create geometry shapes, are you saying that I can change the radius of an object and also the visiblility of an object?

The CelX calls to change the radius and visibility are documented at http://en.wikibooks.org/wiki/Celestia/C ... ua_Methods

I hope this helps a little.
Selden

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

Re: Celx Simple geometry creation

Post #6by Vincent » 23.04.2009, 16:32

selden wrote:
andrtose wrote:* CELX Scripting improvements:
- OpenGL drawing commands allow scripts to display custom graphics on screen.
Several calls to OpenGL are available which are intended only for drawing lines and loading pictures "in the plane of the screen". Unfortunately, I don't think they are very well documented. Vincent can tell you more. He uses them in the Lua Edu Addon. See viewtopic.php?f=11&t=13162.

andrtose,

OpenGL commands are only available through the Lua Hook process.
They won't work in celx scripts. Where did you get the above text information from?
@+
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

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Celx Simple geometry creation

Post #7by selden » 23.04.2009, 16:49

Vincent,

It's in the file release notes for V1.5.0 on SourceForge.

See https://sourceforge.net/project/shownot ... _id=571422
[edit]
It's also in the announcement of v1.5.0 here on the forum at
viewtopic.php?f=2&t=11953
[/edit]
Selden


Return to “Scripting”