; Created by Frank Skilton, modified for Torque Developer Network by Russell Fincher.
; Original documentation: http://www.terathon.com/wiki/index.php?title=Making_a_Skybox_Using_Terragen 
;
; 1. Uncheck "Fixed Height Above Surface"
; In the horizontal plane, the "z" value will be the same as the
; camera automatically (unless you override the value). However,
; we are also going to be taking pictures of the UP (and possibly
; DOWN) directions relative to the camera position so we don't want
; the target fixed.
;
; 2. Set cloud/sunlight parameters
;
; 3. To the left side of the Rendering Control window there is a
; scroll bar next to the word "Detail". Set Detail to Maximum (far
; right). Also, click on the SETTINGS button to view the RENDER
; SETTINGS window. In the QUALITY section, scroll "Atmosphere" and
; "Cloud shading" to high accuracy. In the OPTIONS section uncheck
; the "Render Lanscape" option.
;
; 4. Below the SETTINGS button is a section to control the IMAGE SIZE.
; Set the Image Size width and height to desired setting.  The images
; should be square and in powers of two (i.e., 128x128, 256x256).
;
; 5. Make sure the folder listed below exists,  If not, create it.  

initanim "C:\Documents and Settings\All Users\Desktop\Skybox Renders", 1 

; InitAnim  BaseImageFileName,StartFrameNumber
; The InitAnim command tells Terragen that an animation is to be
; rendered, and initialises the appropriate variables. It is
; necessary to have this command before any calls to FRend.
;
; We don't want clouds moving for skybox renderings, but I've put
; the comments below for information---
; CloudVel is used to automatically scroll the clouds across the
; sky. It will position the clouds correctly for each frame, no
; matter what frame number the script starts at. CloudPos tells
; Terragen where the clouds would be if it were rendering frame 0.
; CloudPos  x,y         ;the cloud position at frame 0
; CloudVel  speed, heading   ;cloud scroll speed per frame
;               (for entire animation)
;
; CamState      xpos,ypos,zpos,head,pitch,bank,zoom,exposure
;               (set zoom or exposure to a negative value to ignore)
; CamPos        x,y,z
; TarPos        x,y,z
; The x,y,z units are in Terragen terrain units; they could also be
; entered as meters
;
; CamOri        head,pitch,bank
; CamH          head
; CamP          pitch
; CamB          bank
;
; Zoom          zoom
; The FOV (field-of-view) formula in Terragen is 2 * tan-1( 1 / zoom ).
; If zoom = 1, then the FOV is 90
;
; Exp           exposure
; ShadowLight   lightness (must be in the range 0 to 100)
; WaterLevel    z
; SunDir        head,alt
;
; FRend ;(frame render, only works after using InitAnim)
;
;
; Terragen sun headings are calculated from north (0 degrees). If the
; angle is from the east they are positive angles down the right side
; to south (+180 degrees); if the sun is bearing from the west, the
; angles are negative from north (0) to south (-180).
;
;This should give us a mid-morning sun

sundir 120,50

;_rt 1 PosX  --->rotate east
Zoom 1.0
CamPos 128 128 0
TarPos 256 128 0
CamH 90
CamP 0
CamB 0
FRend

;_lf 2 NegX  --->rotate west
Zoom 1.0
CamPos 128 128 0
TarPos 0 128 0
CamH -90
CamP 0
CamB 0
FRend

;_ft 3 PosY  --->rotate north
Zoom 1.0
CamPos 128 128 0
TarPos 128 256 0
CamH 0
CamP 0
CamB 0
FRend

;_bk 4 NegY  --->rotate south
Zoom 1.0
CamPos 128 128 0
TarPos 128 0 0
CamH 180
CamP 0
CamB 0
FRend

;_up 5 PosZ --->rotate to south and pitch up 
Zoom 1.0
CamPos 128 128 0
TarPos 128 128 128
CamH 180
CamP 90
CamB 0
FRend

;_dn 6 NegZ --->rotate to north and pitch down
Zoom 1.0
CamPos 128 128 0
TarPos 128 128 -128
CamH 0
CamP -90
CamB 0
FRend

; Post-processing:
; Convert files to Torque-ready format, rename,
; and move to appropriate folder.