PDA

View Full Version : Tunnel View



Mick_Berg
July 10th, 2015, 02:13 PM
I'm glad to discover that in TANE, the issue of tracks that have "istunnel" set, (so that you get a lowered view in tunnels) where they would not join to other tracks, seems to be resolved. But the viewpoint seems to be wrong, it is too high and you see through the roof of the tunnel.
Is this something we can fix? Where is the viewpoint specified? Or is it buried in the code?
Thanks,
Mick

rumour3
July 10th, 2015, 03:16 PM
The idea of switching to an exterior 'on the roof' view, rather than a cab/interior view, has never struck me as a good thing. If we're stuck with it, the code needs to recognise the huge difference between US and UK (for example) loading gauges, and adjust the tunnel view accordingly. For UK stock, clearances can be pretty tight, so a figure very close to the roof of the traincar would be good. Another thing that would probably help would be to restrict the height and fov in tunnels. This should be configurable in the tunnel asset- ext-view-height and default-fov might be an idea for tags.

R3

clam1952
July 10th, 2015, 03:33 PM
Lol you should see how far out and ridiculous it is on my FR WHR route using the correct height tunnels, got round it by using track marks to switch to cab view in tunnels. Otherwise the camera is above the roof of the tunnel! was bad in previous versions even worse now.

In fact other than where there is no interior why can't istunnel switch to cab view anyway? problem then solved.

JCitron
July 10th, 2015, 03:49 PM
I can never see why sitting on the roof is any good anyway. I'd prefer to stand on the front of the locomotive if possible, or be in the cab.

Even over where I am, tunnel heights can be pretty tight. NS and Pan Am are investigating the raising the ceiling of the famous Hoosac Tunnel. Presently, only standard sized freight cars and single stacks can go through. The tunnel roof was raised once before during the 1970s and they may not be able to do it this time around due to the type of soil on the east end.

John

Mick_Berg
July 10th, 2015, 05:32 PM
Lol you should see how far out and ridiculous it is on my FR WHR route using the correct height tunnels, got round it by using track marks to switch to cab view in tunnels. Otherwise the camera is above the roof of the tunnel! was bad in previous versions even worse now.

In fact other than where there is no interior why can't istunnel switch to cab view anyway? problem then solved.
There is a scripted portal by andi06 (I think) that changes the view to cab and back when you leave the tunnel. It works with any track, and works well.
But TBH I prefer the tunnel views. It would be nice and warm sitting on the boiler of an N2. I was just wondering if there is a way to adjust the viewpoint, it was fine in TS12.
Mick

andi06
July 10th, 2015, 05:49 PM
Try tunnelcamoffset x,y,z

This goes in a traincar asset and takes a list of three floats which are presumably X,Y and Z offsets relative to the traincar origin.

clam1952
July 10th, 2015, 08:08 PM
Try tunnelcamoffset x,y,z

This goes in a traincar asset and takes a list of three floats which are presumably X,Y and Z offsets relative to the traincar origin.

Lol, thanks for that, I asked if there was any way of changing the camera height in tunnels a couple of years back, got zero replies!

Mick_Berg
July 10th, 2015, 11:20 PM
Try tunnelcamoffset x,y,z

This goes in a traincar asset and takes a list of three floats which are presumably X,Y and Z offsets relative to the traincar origin.
Again, thanks for that! I now think I remember it from before I had my hiatus from Trainz.
But doesn't that mean that every traincar has to be customized? And why was there a change from TS12 to TANE?
Thanks,
Mick.

Mick_Berg
October 21st, 2015, 02:16 AM
Lol you should see how far out and ridiculous it is on my FR WHR route using the correct height tunnels, got round it by using track marks to switch to cab view in tunnels. Otherwise the camera is above the roof of the tunnel! was bad in previous versions even worse now.

In fact other than where there is no interior why can't istunnel switch to cab view anyway? problem then solved.

I was in agreement with you until I drove through an old tunnel in the re-vamped Rosworth Vale route. It looked so good! I now can't agree about just defaulting to cab view. But the tunnel (Tunnel Darkstone) was unrealistically high and wide, it will be difficult to get it right in realistically proportioned tunnels, especially old UK ones.
Mick

Mick_Berg
October 21st, 2015, 02:19 AM
Try tunnelcamoffset x,y,z

This goes in a traincar asset and takes a list of three floats which are presumably X,Y and Z offsets relative to the traincar origin.

What would default values be? I have no idea where to begin! Anyone know of a traincar that has this tag in its config?
Thanks,
Mick

pcas1986
October 21st, 2015, 03:21 AM
What would default values be? I have no idea where to begin! Anyone know of a traincar that has this tag in its config?
Thanks,
Mick

Mick.
The defaults are 0,0,5 and are part of a KIND traincar config. As Andi suggested I suspect they are offsets from the asset origin since the Z value is 5 (metres?). Some experimentation is probably required.

I'm not aware of any traincars using it.

I'm updating the KIND Traincar page at present so I'll add that tag to the list.

Mick_Berg
October 21st, 2015, 11:36 AM
Hi Paul.
I found good values for the one loco I have made, the battery loco, were 0, -10, and 2.The Y value is way off the default, I wonder why?
I think you would have the .im file for that loco, would you care to take a look? Probably something I did wrong.........
Cheers,
Mick

pcas1986
October 21st, 2015, 02:54 PM
My guess is that the default values are the centre of the bounding box of the traincar for X and Y, plus 5 metres in Z/height to place it roughly a metre above the standard height of traincars. On reflection, I think those default values are as good as any.

Your battery locos would be much lower in height due to London Underground requirements but your Z value of 2 seems a bit low unless you wanted below the roof line and ahead of the loco.

Assuming the IM files I have are the same, and N3V are using bounding box values, then I think that location would be about 1.5 metres ahead of the loco and 2/3rds of the height.

The bounding box size is 2.628, 16.921 and 2.699.

I'm curious to find out if TANE has the smarts to reverse the Y location if the traincar is reversed .

Mick_Berg
October 22nd, 2015, 02:46 PM
My guess is that the default values are the centre of the bounding box of the traincar for X and Y, plus 5 metres in Z/height to place it roughly a metre above the standard height of traincars. On reflection, I think those default values are as good as any.

Your battery locos would be much lower in height due to London Underground requirements but your Z value of 2 seems a bit low unless you wanted below the roof line and ahead of the loco.

Assuming the IM files I have are the same, and N3V are using bounding box values, then I think that location would be about 1.5 metres ahead of the loco and 2/3rds of the height.

The bounding box size is 2.628, 16.921 and 2.699.

I'm curious to find out if TANE has the smarts to reverse the Y location if the traincar is reversed .
Thanks again Paul.
I just found values that worked, certainly some fine tuning is needed.
It seems that direction is not taken into account.:( Which makes me wonder if a script could be written, which would calculate the values for X, Y and Z based on the bounding box dimensions, and change the sign (thats the wrong word, I'm no mathematician) of the Y value according to direction, and plug those values into the tag?
Can't think of anyone who might write the script though.........:hehe:
Mick

pcas1986
October 23rd, 2015, 03:15 AM
...Which makes me wonder if a script could be written, which would calculate the values for X, Y and Z based on the bounding box dimensions, and change the sign (thats the wrong word, I'm no mathematician) of the Y value according to direction, and plug those values into the tag?
...
Mick

I'm not aware of any functions that access the mesh object bounding box. There are functions to determine if a train is in a tunnel, get the orientation of the traincar and select internal/external view. But I cannot see any function to select a particular camera location within the traincar itself. There are functions to set a camera angle but whether they can be used for your purpose is doubtful. On reading the related documentation, I get the impression they are mostly intended for cameras scattered around a route. But I could be wrong...

Mick_Berg
October 24th, 2015, 04:02 PM
I'm not aware of any functions that access the mesh object bounding box. There are functions to determine if a train is in a tunnel, get the orientation of the traincar and select internal/external view. But I cannot see any function to select a particular camera location within the traincar itself. There are functions to set a camera angle but whether they can be used for your purpose is doubtful. On reading the related documentation, I get the impression they are mostly intended for cameras scattered around a route. But I could be wrong...

When you think about it, the same amount of effort would be needed to insert the script in every loco as to just add the tag, and plug in the proper values. It's very easy to do, thanks to the bounding box function in Asset-X. I've found that this works; X can stay at zero, Y is the bounding box length divided by 2 plus a bit to get it in front of the loco, and made negative due to how locos are constructed, and 3 seems to be a good compromise for Z.

Cheers,
Mick