How to add a moon
by JohnT · in Torque Game Engine · 05/25/2005 (2:30 pm) · 18 replies
I'm extremely new at Torque and was hoping that someone could point me in the right direction on how I would go about placing a 2D image of the moon on the SkyBox.
Originally I wanted to use a 3D moon but found out quickly that this would be a problem due to different players seeing it from different angles.
Thanks,
John
Originally I wanted to use a 3D moon but found out quickly that this would be a problem due to different players seeing it from different angles.
Thanks,
John
About the author
#2
Unfortunately the static SkyBox will not work since I plan on having different phases of the moon and to have its position change throughout a specified time period.
I have tried the Flare object and have been able to get it to show on the SkyBox except that it resizes everything to an unnaturally large size.
Is there another way of accomplishing this or does it look like I'm going to need to go and delve into the engine to figure out why the Flare?
05/25/2005 (3:57 pm)
Viktor, thanks for the suggestions!Unfortunately the static SkyBox will not work since I plan on having different phases of the moon and to have its position change throughout a specified time period.
I have tried the Flare object and have been able to get it to show on the SkyBox except that it resizes everything to an unnaturally large size.
Is there another way of accomplishing this or does it look like I'm going to need to go and delve into the engine to figure out why the Flare?
#3
05/25/2005 (4:02 pm)
That's changeable in the datablock John. You will however find a problem where the "sun" is rendered eventho you can't actually see it. Say you're inside a building and somewhere there's this little leak out, you'll get the big sun rendered infront of the wall ^^
#4
05/25/2005 (4:25 pm)
Use a billboard. That way, it will orient itself correctly.
#5
05/25/2005 (4:53 pm)
Sorry to show my ignorance on this but is a billboard the same thing as a static shape? If it's not, how would I place one on the SkyBox?
#6
05/25/2005 (5:03 pm)
I tried several ways to do this. The skybox method was the worst, the moon looked terrible when it wasn't exactly in the center. The best method was to use the fxSunlight object. Notice that "localflarebitmap" is set to a false value ('nil1'), so it doesn't render the front flare (this is bad). Here is one of the datablocks that I used. new fxSunLight(moon) {
position = "1501.27 291.954 236.381";
rotation = "1 0 0 0";
scale = "1 1 1";
Enable = "1";
LocalFlareBitmap = "nil1";
RemoteFlareBitmap = "~/data/shapes/moon3";
SunAzimuth = "30";
SunElevation = "60";
LockToRealSun = "0";
FlareTP = "1";
Colour = "1.000000 1.000000 1.000000 0.500000";
Brightness = "1";
FlareSize = "1";
FadeTime = "0.1";
BlendMode = "0";
AnimColour = "1";
AnimBrightness = "0";
AnimRotation = "0";
AnimSize = "1";
AnimAzimuth = "0";
AnimElevation = "1";
LerpColour = "1";
LerpBrightness = "1";
LerpRotation = "1";
LerpSize = "1";
LerpAzimuth = "1";
LerpElevation = "1";
LinkFlareSize = "0";
SingleColourKeys = "1";
MinColour = "1.000000 1.000000 1.000000 0.500000";
MaxColour = "1.000000 1.000000 1.000000 0.500000";
MinBrightness = "0";
MaxBrightness = "1";
MinRotation = "0";
MaxRotation = "359";
minSize = "0.6";
MaxSize = "0.6";
MinAzimuth = "0";
MaxAzimuth = "359";
MinElevation = "144";
MaxElevation = "144";
RedKeys = "AZA";
GreenKeys = "AZA";
BlueKeys = "AZA";
BrightnessKeys = "AZA";
RotationKeys = "AZA";
SizeKeys = "AZA";
AzimuthKeys = "AZ";
ElevationKeys = "AZ";
ColourTime = "5";
BrightnessTime = "5";
RotationTime = "5";
SizeTime = "5";
AzimuthTime = "5";
ElevationTime = "500";
};
#7
Of course, if you have people flying, they can literally fly to the moon.
05/26/2005 (7:00 am)
You don't have to place the billboard on the skybox, but up on the sky. You can also control its movement with script.Of course, if you have people flying, they can literally fly to the moon.
#8
I would love to give the billboard a try but do not know how to create one. Is there any resources on this site that might help me out?
05/26/2005 (7:04 am)
Thanks JMac for the post. It did help cleanup the image but I am still having the scaling problem. I have tried using the scalling parms in the fxSunLight object but still it made no difference.I would love to give the billboard a try but do not know how to create one. Is there any resources on this site that might help me out?
#9
05/26/2005 (7:36 am)
You tryed (scale = "1 1 1";) or (FlareSize = "1";) and another params with "size" in there names?
#10
The moon now behaves exactly as it should and does not have that nasty habit of showing over mountains and houses like before.
Thanks for all the help!!!
05/26/2005 (7:54 am)
Turns out it is minSize, maxSize! Thanks Viktor, I just kept trying scale.The moon now behaves exactly as it should and does not have that nasty habit of showing over mountains and houses like before.
Thanks for all the help!!!
#11
05/26/2005 (8:05 am)
You are welcome.
#12
WHY is it bad to show the front flare?
What did you adjust minSize and maxSize to so that they do not show overtop of mountains and houses?
Why does my moon appear bright white and just like a giant circle of brightness? I can't seem to find a way to scale down the brightness so that it's still bright, with a corona, but you can see the pockmarks of the moon bitmap.
Any ideas?
07/16/2005 (12:46 pm)
Sorry to dig up an old post, but some of these would be very useful to me but were not exactly explained.WHY is it bad to show the front flare?
What did you adjust minSize and maxSize to so that they do not show overtop of mountains and houses?
Why does my moon appear bright white and just like a giant circle of brightness? I can't seem to find a way to scale down the brightness so that it's still bright, with a corona, but you can see the pockmarks of the moon bitmap.
Any ideas?
#13
www.illumina-game.com/index.php/mod/gallery/file/display/image/142?asc=&sort=i.a...
07/16/2005 (1:03 pm)
This is about 4 or 5 FxSuns all overlapped with both front and back iamges rendering. It's a little washed out, but I believe that's fixed now.www.illumina-game.com/index.php/mod/gallery/file/display/image/142?asc=&sort=i.a...
#14
2. ? don't know, what I posted worked great for me. Nothing showed in front of my houses or mountains.
3. The moon is added in - this helps make it look like it's behind the sky (not drawn on top of it). Darken your bitmap considerably.
07/16/2005 (1:49 pm)
1. There are two parts to the flare, the part the shows behind everything, and the part that shows in the front. You don't want a "front" moon that shows in front of everything.2. ? don't know, what I posted worked great for me. Nothing showed in front of my houses or mountains.
3. The moon is added in - this helps make it look like it's behind the sky (not drawn on top of it). Darken your bitmap considerably.
#15
07/17/2005 (9:02 pm)
Thanks. That worked.
#16
11/11/2005 (3:06 pm)
Hmmm. I got this to work, except Celestials-Day/Night is locking it to the sun... Going to have to change that. Anyone ever do this before?
#17
02/24/2006 (5:18 pm)
Just a note for those that are new to Torque. For night missions set the BlendMode to 1 instead of 0, then adjust the brightness accordingly. But for a day mission you will want to leave the BlendMode at 0.
#18
09/11/2007 (4:52 pm)
Steven you ever get this one done?
Torque Owner Viktor Kuropyatnik
Another way is to use Flare (you can see it in demo, look at *.mis file) but change a texture that it use and parameters, if you dont want to see orange moon :)