rfranzosa, on 11 January 2018 - 12:20 PM, said:
There is no parameter in the cone of light code for direction. It is hard coded to 'forward', I assume. ................snip...............................
Hi Rick,
That turns out not to be the case.
You can have a rear facing cone. You just can't have both front and rear cones on at the same time.
Here is a clip from the code I use for most of my engines.
The headlight switch controls which cone is on: Headlight Dim : Rear Headlight and Rear Cone on.
Headlight Bright : Front Headlight and Front Cone on.
There are probably other/better ways to code this but this works.
It's the
Azimuth and
Position fields in the engine file lighting section that get this for you,
Lights ( nn
Light (
comment( Front Sphere of Light High Beam )
Type ( 1 )
Conditions (
Headlight ( 3 )
Unit ( 2 )
)
Cycle ( 0 )
FadeIn ( 0.5 )
FadeOut ( 0.5 )
States ( 1
State (
Duration ( 0.0 )
LightColour ( ffffffff )
Position ( 0.0 3.5 5.0 )
Transition ( 0 )
Radius ( 200.0 )
Angle ( 20.0 )
)
)
)
Light (
comment( Sphere of light Rear by Vince Cockeram )
Type ( 1 )
Conditions (
Headlight ( 2 )
Unit ( 3 )
)
Cycle ( 0 )
FadeIn ( 0.5 )
FadeOut ( 0.5 )
States ( 1
State (
Duration ( 0.0 )
LightColour ( ffffffff )
Azimuth ( -5.0 -180.0 5.0 )
Position ( 0.0 3.5 -5.0 )
Transition ( 0 )
Radius ( 88.0 )
Angle ( 30.0 )
)
)
)
Another trick is getting the cone to show closer to the engine. Since the cone has no visible 'source' so to speak, the get the cone to show closer
simply lower the cone by using a smaller value for the Y (Up/Dn) axis.
This has the effect of having the cone show closer to the loco.
Fiddle with the Radius and Angle values also and you can have excellent rear lighting on any engine that has a Bright/Dim/Off headlight switch.
Enjoy!
regards,
vince