Page 1 of 1
scripting a star
Posted: 22.04.2010, 21:11
by fungun
Can you move a star by a script?
I am trying to make a Photon Torpedo. I cannot make it bright, semi-transparent, and fuzzy all at the same time.
I have already tried to do it all in a 3ds mesh converted to cmod. I have also tried to give my mesh an atmosphere, that turned out horrible.
So I made my mesh into a star using a stc file, but it has to move from one ship to another.
Any other ideas would be greatly appreciated.
Thanks,
Tim
Re: scripting a star
Posted: 23.04.2010, 15:59
by selden
Sorry, Star orbits can only be elliptical, not scripted.
You might try using CMOD sprites.
p.s. some other options to try would be
Emissive true
to make the object bright
and
Atmosphere {...}
to provide a translucent, fuzzy region surrounding it.
Re: scripting a star
Posted: 23.04.2010, 21:44
by fungun
This is what I have so far.
Is this what you meant?
Not sure about using sprites. Never done anything with them before.
Thanks,
Tim
http://www.youtube.com/watch?v=asxZHZTpf3k
Re: scripting a star
Posted: 23.04.2010, 22:16
by selden
That looks reasonably good to me!
Re: scripting a star
Posted: 23.04.2010, 23:16
by Fenerit
fungun wrote:Can you move a star by a script?
I am trying to make a Photon Torpedo. I cannot make it bright, semi-transparent, and fuzzy all at the same time.
I have already tried to do it all in a 3ds mesh converted to cmod. I have also tried to give my mesh an atmosphere, that turned out horrible.
So I made my mesh into a star using a stc file, but it has to move from one ship to another.
Any other ideas would be greatly appreciated.
Thanks,
Tim
For moving objects, take a look here:
http://www.shatters.net/forum/viewtopic.php?f=21&t=14419First try to script you 3d model in order to accomplish the due movement, then the eye-candy.
Re: scripting a star
Posted: 24.04.2010, 03:38
by VikingTechJPL
Tim,
Here's a "quick and dirty" method that may help get you started or at least give you some other ideas.
The photon torpedo (smaller star) is actually a star circling a barycenter, so it actually moves between the 2 ships (the larger stars) only once each orbit in CELESTIA. Still, if you save (as cel:urls) its motion between the stars several different times (and from several different angles), you can call them sequentially from your script and produce the effect of many torpedo shots.
Basically, in an stc file, I've created two fixed stars that are near each other and 500 light years from Earth. You'll see their coordinates in the stc files. You would substitute your ships in these locations. Then I created a star moving around a barycenter located at the Earth and in the same plane and at the same distance as the two fixed stars. So on Jan 1, 2000 the small star starts moving from FixedStar1 to FixedStar2 because everything in CELESTIA is geared to the J2000 epoch. As I said, you can change your camera to look at this from any angle and any distance. Because the radius of the small star's (photon torpedo's) orbit is so large, it looks like it's moving in a straight line.
If you're making a movie instead of a script, you can record many little clips from a bunch of different angles and then stitch them together. If you want FixedStar2 to return fire, just run time backwards after the small star has reached it. The demo AVI video shows the photon torpedo (smaller star) bouncing back and forth because I just kept reversing time. The included AVI's very rough, only meant to show that motion is possible.
You'll need to make sure that all of your distances and sizes are consistent, because the units for stars and satellites are not expressed the same in CELESTIA (assuming, that is, that your models are satellite objects). CELESTIA's source code has all of the constants and multiples you'll need.
Not knowing what version of CELESTIA you're using, I've included an stc for both for 1.4.1 and 1.6.0. Each also contains a "commented out" cel:url that you can put in a word processor and use after you're installed the stc files in your extras folder and restarted CELESTIA.
Let me know how it works out. I hope it helps.
Gary
Re: scripting a star
Posted: 24.04.2010, 11:42
by Fenerit
For a rotated point sprites object that could resemble aphoton torpedoes look here:
http://www.shatters.net/forum/viewtopic.php?f=11&t=14066Try to lower the radius and to make the texture more "striking lights". Such model do the rotation only, the ScriptOrbit could make it move in straight line...
Re: scripting a star
Posted: 24.04.2010, 19:58
by fungun
Thank you guys very much.
Will try both and see what I come up with.
Tim