Engine lights
3 posters
Page 1 of 1
Engine lights
Hello guys,
I was thinking if someone can advise me on train lights. I have been able to create the "light" effect for the 163 engine, but for some reason, the light is not visible from inside the loco. The light effect code is as follows:
It is just a work version, but I am sort of sure it would be visible from a 3D cab. Is there any solution for a 2D cab as well?
I was thinking if someone can advise me on train lights. I have been able to create the "light" effect for the 163 engine, but for some reason, the light is not visible from inside the loco. The light effect code is as follows:
- Code:
CreateMeshBuilder,
Cylinder, 32, -0.08, -4, 15
Rotate,1,0,0,85
Translate,0,-0.65,-7.5
SetColor,250,245,226,20
SetEmissiveColor,250,245,226
It is just a work version, but I am sort of sure it would be visible from a 3D cab. Is there any solution for a 2D cab as well?
Re: Engine lights
Whilst in a 2D cab, I don't believe the exterior objects are rendered at all, and therefore the short answer to your question is not easily AFAIK.
Dennis Lance did some playing with the ambientlight and directionallight parameters at one stage, but I'm not sure anyone went any further than that.
This is an off the top of my head thought/ fudge though (I haven't tested or attempted to implement this, but I think the theory is sound as it's not trying to do anything remotely interesting):
In your routefile add a new rail with an associated dike/ wall. (I use rail 99 for weather effects)
Create an object for each curve radius with one rising plane of transparency to the height of your headlights beam.
Set these objects to be emissive from both sides at an appropriate color.
Build an animated file to trigger the objects when the headlights are lit.
Finally, set fog to the approximate view distance of your headlights.
TBQH, if that works, you'd probably get away with a single straight object, but the lighting would probably look better on curves with the curved variants.
I'll try and do some proper cooking at some stage and see what I can come up with.
Cheers
Chris Lees
http://www.bvecornwall.co.uk
Dennis Lance did some playing with the ambientlight and directionallight parameters at one stage, but I'm not sure anyone went any further than that.
This is an off the top of my head thought/ fudge though (I haven't tested or attempted to implement this, but I think the theory is sound as it's not trying to do anything remotely interesting):
In your routefile add a new rail with an associated dike/ wall. (I use rail 99 for weather effects)
Create an object for each curve radius with one rising plane of transparency to the height of your headlights beam.
Set these objects to be emissive from both sides at an appropriate color.
Build an animated file to trigger the objects when the headlights are lit.
Finally, set fog to the approximate view distance of your headlights.
TBQH, if that works, you'd probably get away with a single straight object, but the lighting would probably look better on curves with the curved variants.
I'll try and do some proper cooking at some stage and see what I can come up with.
Cheers
Chris Lees
http://www.bvecornwall.co.uk
Re: Engine lights
Come to think of it, I could probably create an animated object that would travel along with the train. However, this is not so easy either, as the Translate functions only know uncurved directions and are unable to follow a certain rail. You are probably right the exterior parts of the engine don't work while in a 2D cab, that would explain the pantograph occurrences I have had recently.
Re: Engine lights
Good and bad news
I've just remembered an OpenBVE bug I found when building the 81xx-
If you setup your train.dat in exactly the right way and use a .animated object for this first car, this will show up in the sim. (In my case it was a randomly floating along front pony truck...)
The bad news is that animations don't seem to work right on this 'object', so you're stuck with it as is.
The attached file is a modified train.dat (It needs the car length to be 0.01, and most of the numbers to be the exact length they are in there), extensions.cfg & headlight object.
Don't know how far it'll get you, as you'd need separate trains for headlights on and off, but it's an interesting curiosity if nothing else.
Cheers
Chris Lees
http://www.bvecornwall.co.uk
I've just remembered an OpenBVE bug I found when building the 81xx-
If you setup your train.dat in exactly the right way and use a .animated object for this first car, this will show up in the sim. (In my case it was a randomly floating along front pony truck...)
The bad news is that animations don't seem to work right on this 'object', so you're stuck with it as is.
The attached file is a modified train.dat (It needs the car length to be 0.01, and most of the numbers to be the exact length they are in there), extensions.cfg & headlight object.
Don't know how far it'll get you, as you'd need separate trains for headlights on and off, but it's an interesting curiosity if nothing else.
Cheers
Chris Lees
http://www.bvecornwall.co.uk
- Attachments
Re: Engine lights
Yeah, the solution is a bit similar to the "bogies" thing. So, you are saying if I put a simple state change, it is not gonna work for me? I might as well put it at the end of the train and just substract the corresponding value... but it would be rotating incorrectly in curves alright. :-(
Re: Engine lights
Could be achieved if OpenBve ever reached that potential
Northern Line- Posts : 329
Join date : 2011-07-12
Age : 31
Location : London, UK
Similar topics
» Central Line Openbve Technical Problems
» Interior lights flickering independently at third rail gaps.
» Blinking lights
» Steam engine Controls...
» openBVE plugin blinking lights problem
» Interior lights flickering independently at third rail gaps.
» Blinking lights
» Steam engine Controls...
» openBVE plugin blinking lights problem
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum