BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Engine lights

3 posters

Go down

Engine lights Empty Engine lights

Post by Dexter Tue Jun 17, 2014 12:40 am

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:

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?
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Engine lights Empty Re: Engine lights

Post by leezer3 Tue Jun 17, 2014 2:00 am

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

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Engine lights Empty Re: Engine lights

Post by Dexter Tue Jun 17, 2014 2:06 am

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.
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Engine lights Empty Re: Engine lights

Post by leezer3 Fri Jun 20, 2014 1:52 am

Good and bad news Razz
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
Engine lights Attachment
163-133-7v4.zip You don't have permission to download attachments.(3 Kb) Downloaded 0 times

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Engine lights Empty Re: Engine lights

Post by Dexter Fri Jun 20, 2014 1:56 am

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. :-(
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Engine lights Empty Re: Engine lights

Post by Northern Line Fri Jun 20, 2014 9:28 am

Could be achieved if OpenBve ever reached that potential
Northern Line
Northern Line

Posts : 329
Join date : 2011-07-12
Age : 31
Location : London, UK

Back to top Go down

Engine lights Empty Re: Engine lights

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum