Changing object X,Y,Z position by editing GeoPcDx File

Everyone should have a go at this, creating a bit of basic scenery is really quite easy and certainly within the grasp of anyone - find some tutorials, ask questions, and keep it simple to start with (a simple box!) and get that buzz when it shows up in the sim as your very own object! Then upload it to UKTS and share it with others!

Moderator: Moderators

lomasra
Getting the hang of things now
Posts: 34
Joined: Sat May 27, 2006 1:01 pm

Changing object X,Y,Z position by editing GeoPcDx File

Post by lomasra »

I've been playing around with traffic management and vehicle property files and managed to get a few freeware scenery cars and vans running nicely as traffic (a big thanks to Jeff Layfield and others for their excellent scenic vehicles).

I would like to add more of these vehicles to my traffic but I guess they weren't created with traffic in mind - some run backwards or sideways or buried up to the windows!

You can see my problem just by picking and placing a scenery vehicle in a route without adjusting its height or direction. Unless the wheels sit on the ground and it faces in the same direction as RW default vehicles do then it seems that vehicle can't readily be used for traffic.

I've been looking in the vehicle GeoPcDx files for anything which might be tweakable to adjust initial height and orientation of an object when placed in a route but not had any joy so far.

Can any one help please.
Thanks,
Richard
pauls
Very Active Forum Member
Posts: 1443
Joined: Wed Jan 14, 2004 6:47 pm

Re: Road vehicle GeoPcDx files

Post by pauls »

lomasra wrote:I've been playing around with traffic management and vehicle property files and managed to get a few freeware scenery cars and vans running nicely as traffic (a big thanks to Jeff Layfield and others for their excellent scenic vehicles).

I would like to add more of these vehicles to my traffic but I guess they weren't created with traffic in mind - some run backwards or sideways or buried up to the windows!

You can see my problem just by picking and placing a scenery vehicle in a route without adjusting its height or direction. Unless the wheels sit on the ground and it faces in the same direction as RW default vehicles do then it seems that vehicle can't readily be used for traffic.

I've been looking in the vehicle GeoPcDx files for anything which might be tweakable to adjust initial height and orientation of an object when placed in a route but not had any joy so far.

Can any one help please.
Thanks,
Richard
Hi Richard,

Try the bin file.

Cheers
Paul
lomasra
Getting the hang of things now
Posts: 34
Joined: Sat May 27, 2006 1:01 pm

Re: Road vehicle GeoPcDx files

Post by lomasra »

Hi Paul,

Thanks for the suggestion. If you mean the Scenic item bin file I don't think it has any effect on traffic. The traffic manager uses vehicle properties bin files which call only the geopcdx of the vehicles. The vehicle properties bin file doesn't appear to have any option for adjusting the position of the vehicle.

Richard
pauls
Very Active Forum Member
Posts: 1443
Joined: Wed Jan 14, 2004 6:47 pm

Re: Road vehicle GeoPcDx files

Post by pauls »

lomasra wrote:Hi Paul,

Thanks for the suggestion. If you mean the Scenic item bin file I don't think it has any effect on traffic. The traffic manager uses vehicle properties bin files which call only the geopcdx of the vehicles. The vehicle properties bin file doesn't appear to have any option for adjusting the position of the vehicle.

Richard
Ok - a bit more complex than I thought then - always the case isn't it ! :)

Cheers
Paul
User avatar
eyore
Very Active Forum Member
Posts: 1225
Joined: Tue Jan 27, 2004 6:22 pm
Location: Cumbrian hills

Re: Road vehicle GeoPcDx files

Post by eyore »

As far as I am aware, the geopcdx files cannot be amended in the manner you require.

When faced with a similar problem I contacted the asset authors and asked if they would provide either a suitably adjusted model, or their source files so I could amend the model myself. No one refused to help.

Perhaps you may try the same idea?
Phil

Image
nobkins
Very Active Forum Member
Posts: 4421
Joined: Fri Jun 12, 2009 11:51 pm
Location: Leeds

Re: Road vehicle GeoPcDx files

Post by nobkins »

A possible alternative would be to have the car as a child object. Child objects can be positioned relative to their parent object so in effect you an raise, lower, flip round etc. No idea if traffic BP's will load up an object that uses a child object.

Gets quite complex. I would go with eyore's suggestion first of all and only look at this if that fails. You will still need permission (unless it is for personal use only) to modify someone elses work.

I am trying to find the time to make a Roads & Traffic Freeware pack. It is high on the list of things to do but other items getting in the way at the moment :D

Jim
TrainSimDev.com The community dedicated to those who create content for any Train Simulator.
Includes: Free downloads via torrent or browser, forum browsable by all, membership by invitation (any member can invite someone)
User avatar
eyore
Very Active Forum Member
Posts: 1225
Joined: Tue Jan 27, 2004 6:22 pm
Location: Cumbrian hills

Re: Road vehicle GeoPcDx files

Post by eyore »

snip
nobkins wrote:A possible alternative would be to have the car as a child object. Child objects can be positioned relative to their parent object so in effect you an raise, lower, flip round etc. No idea if traffic BP's will load up an object that uses a child object.

Jim
Unfortunately, traffic can't have child objects which is why, for instance, you can't have exhaust fumes because you can't add a particle generator. :cry:
Phil

Image
lomasra
Getting the hang of things now
Posts: 34
Joined: Sat May 27, 2006 1:01 pm

Re: Road vehicle GeoPcDx files

Post by lomasra »

Thanks everyone for your help. One of the creators has kindly been in touch and provided a couple of revised vehicles for me to play with. They're up and running now and look great!

Looks like the proposed Freeware Road and Traffic packs may need more of the same generous help from the vehicle modellers!

Richard
User avatar
henningBR218
Been on the forums for a while
Posts: 290
Joined: Fri Jun 16, 2006 11:59 am
Location: Wolfsburg, Germany

Re: Road vehicle GeoPcDx files

Post by henningBR218 »

The easier way would be to make changes in the GeoPcDx file directly.

For changing of object center position & rotation simply search for section:

<SourceLToPTransform>

in there you'll find as many entries as you have objects ("<TransformName>") in the GeoPcDx file in same order. Each entry represents a 4 by 4 matrix of floats which represent the transformation matrix for the object in game. This means absolute position, scale and rotation are defined in this matrix.

Example entry with X, Y, Z rotation = 0.0, scale = 1.0, pos = 11.0/22.0/33.0:
<e d:numElements="16" d:elementType="sFloat32" d:precision="string">1.0000 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 11.0000 22.0000 33.0000 1.0000</e>

The diagonal (top left to bottom right) are the scale values for X, Y, Z (and "world") axis (first to 3rd (4th) row). Those values are usually all 1.0.
The first three values of the last row are the X, Y, Z positions. I'm you you will discover marked similarities of the values with the in-game positions... :)
All the rest of the values are the ("coded") X,Y, Z rotaions of the object. For a 180° rotaion it should be enough to put a minus in front of one of them.

For to find out which axis belongs to which in-game direction simply run a quick test...

But the better/easier way should be: export an own test object with required pos & rot and copy the whole matrix line over...
regards.....BR218
Henning
nobkins
Very Active Forum Member
Posts: 4421
Joined: Fri Jun 12, 2009 11:51 pm
Location: Leeds

Re: Road vehicle GeoPcDx files

Post by nobkins »

I did not know that Henning. Thank you for such a detailed response. Very useful.
TrainSimDev.com The community dedicated to those who create content for any Train Simulator.
Includes: Free downloads via torrent or browser, forum browsable by all, membership by invitation (any member can invite someone)
User avatar
briyeo1950
Very Active Forum Member
Posts: 1795
Joined: Mon Jul 20, 2009 8:33 pm
Location: Derbyshire

Re: Road vehicle GeoPcDx files

Post by briyeo1950 »

Would that mean you could copy the Geo matrix entry over from a Kuju default road vehicle? Or is it not that simple, it usually isn't :-?
@ lomasra, do you have any screenshots of the freeware vehicles running? It would be interesting to see.
I'm looking forward to seeing Jim get some of my bus repaints moving :wink:
nobkins
Very Active Forum Member
Posts: 4421
Joined: Fri Jun 12, 2009 11:51 pm
Location: Leeds

Re: Road vehicle GeoPcDx files

Post by nobkins »

briyeo1950 wrote:Would that mean you could copy the Geo matrix entry over from a Kuju default road vehicle?
That would work if the vehicle was the same dimensions (or very close). However, with most vehicles if it is just a height problem it will just be changing one value (the Y value Henning spoke of). It is also possible to flip (back to front) if the vehicle is the wrong way round for a traffic Blueprint. Copying settings from a default item would not help in this case (I think) because you need to flip the item relative to itself. The settings in a default (or any other item) are relevant to that item.

The child objects use the same matrix (but shown in a different way). I successfully managed to flip and inverse (inside out and outside in) a model that did not show correctly for the Mayflower Line and it's movable boats on hidden rails.

Not sure if I have that all 100% correct but it is my understanding.

Jim
TrainSimDev.com The community dedicated to those who create content for any Train Simulator.
Includes: Free downloads via torrent or browser, forum browsable by all, membership by invitation (any member can invite someone)
User avatar
briyeo1950
Very Active Forum Member
Posts: 1795
Joined: Mon Jul 20, 2009 8:33 pm
Location: Derbyshire

Re: Road vehicle GeoPcDx files

Post by briyeo1950 »

Yes I have managed to do it with child objects, ie. move the object through 90 degrees etc. I use the often very frustrating trial and error method. :wink:
erikkr
Been on the forums for a while
Posts: 223
Joined: Mon Sep 28, 2009 9:38 am

Re: Road vehicle GeoPcDx files

Post by erikkr »

this is an example with a simple box 5 m long, 2 m wide , and 1,5 m high.
box standing on the ground :

<Centre d:numElements="4" d:elementType="sFloat32" d:precision="string">0.0000000 0.7500000 0.0000000 1.0000000</Centre>
<RootMinExtents d:numElements="4" d:elementType="sFloat32" d:precision="string">-2.5000000 0.0000000 -1.0000000 1.0000000</RootMinExtents>
<RootMaxExtents d:numElements="4" d:elementType="sFloat32" d:precision="string">2.5000000 1.5000000 1.0000000 1.0000000</RootMaxExtents>

box 1m above the ground :

<Centre d:numElements="4" d:elementType="sFloat32" d:precision="string">0.0000000 1.7500000 0.0000000 1.0000000</Centre>
<RootMinExtents d:numElements="4" d:elementType="sFloat32" d:precision="string">-2.5000000 1.0000000 -1.0000000 1.0000000</RootMinExtents>
<RootMaxExtents d:numElements="4" d:elementType="sFloat32" d:precision="string">2.5000000 2.5000000 1.0000000 1.0000000</RootMaxExtents>

you see the changes in centre 0.75 -> 1.75 ; min 0 -> 1 , and max 1.5 -> 2.5
User avatar
eyore
Very Active Forum Member
Posts: 1225
Joined: Tue Jan 27, 2004 6:22 pm
Location: Cumbrian hills

Re: Road vehicle GeoPcDx files

Post by eyore »

Thanks guys, I'm really learning alot here, this thread is getting to the point where it should be stickied
Phil

Image
Locked

Return to “[RW] Scenic Item Creation”