Rotate track? (NorthDirection)

Discussion in 'Track Modding' started by Jorgen, Nov 5, 2012.

  1. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Does anyone know if the .gdb "NorthDirection" parameter is still supported? I vaguely remember seeing that it isn't in one of the stock GDB files, but now I can't seem to find that comment anymore. This parameter was a lifesaver when adjusting the ambient track lighting in rF1, so it would be great if it was still supported.

    Rotating the scene file objects obviously works to get north/south aligned properly, but at the same time all x/y coordinates in the .aiw file and all x/y related parameters in the scene file itself (like omni light positions) will require recalculation...
     
  2. Luc Van Camp

    Luc Van Camp Track Team Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    1,030
    Likes Received:
    15
    A track should always be modeled correctly, with the North facing up in top view, full stop :) .

    I just tried it, and the value has no effect. That makes sense because rF2 uses a completely different sky system. So yeah, even if the value is still being used, it doesn't change anything to how the sky is built.
     
  3. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Oh, that's unfortunate. I believe there are plenty of existing rF1 tracks that are not properly modelled in terms of north/south direction, probably because it was possible to correct it via the NorthDirection parameter, so that's a lot of work then I guess. At least if you are a sucker for realism, like me, and want the sunlight to shine from the in-real-life direction at any time. For example, the sun is supposed to shine into the start/finish straight at 17:00 just before the start of the Abu Dhabi GP, but that was way off after converting an (incorrectly modelled) rF1 version of the track. (The whole model is about 72 degrees off, but it's super accurate in most other respects)
     
  4. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Yesterday I successfully rotated (re-computed) all 100+ omni light definitions in a track I'm converting, so it's definitely doable. (It's just a bit of maths and text editing) I might even write a tool to do the job once I'm done, in case anyone would be interested. :)

    EDIT: I've started working on the tool, and it now processes the .scn and .cam files properly, as well as the initial bits of the .aiw file such as grid, garage and pits. There seem to be plenty of directional and positional values in the .aiw file though, but things are looking promising so far.
     
    Last edited by a moderator: Nov 9, 2012
  5. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Looks like the tool is working properly now. I need to do some more testing first, but in case someone wants it, give me a shout. (It's a Java program run at the command prompt, so it's nothing fancy, but it does the job)

    EDIT: Rotated .scn, .cam and .aiw files, and it works great in-game. :)
     
    Last edited by a moderator: Nov 11, 2012
  6. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    In case anyone needs the tool, I have now packaged it as an executable JAR file which is available here:
    http://www.racehub.se/div/RfTrackRotator.jar

    The program arguments are as follows:
    java -jar RfTrackRotator.jar <input file> <degrees>

    You will need a Java JDK or JRE, at least version 5, but anything newer will work too. Note that the program writes the modified data to the screen, so you will need to direct the output to a file manually. Below is a complete example:

    Code:
    java -jar RfTrackRotator.jar C:\rFactor\GameData\Locations\F1LRC11\Monaco\MonteCarloF111\MonteCarloF111.AIW 90 > MonteCarloF111-rotated.AIW
    Feel free to ask if you get stuck somewhere.

    Cheers.
     
  7. ethone

    ethone Registered

    Joined:
    Nov 30, 2011
    Messages:
    1,153
    Likes Received:
    37
    Thanks for the tool Jorgen, we put it to good use. :)

    The one thing that did not work properly were the movement path sections from the .cam file but I think we can scrape by without fancy moving cams during testing and re-do those few cameras for release if we want them back in.
     
  8. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Good news! :) I can take a look at the cam file parsing again, it's probably just something I overlooked. Would you happen to have a copy of your original cam file somewhere online so I can take a peek?
     
    Last edited by a moderator: May 13, 2013
  9. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    The code is now modified to process cam file movement path control points too. The link in post #6 points to the updated code archive.
     
  10. ethone

    ethone Registered

    Joined:
    Nov 30, 2011
    Messages:
    1,153
    Likes Received:
    37
    Thanks, I'll check it out tomorrow!
     
  11. ethone

    ethone Registered

    Joined:
    Nov 30, 2011
    Messages:
    1,153
    Likes Received:
    37
    It works great, thanks again Jorgen!
     
  12. Banger

    Banger Registered

    Joined:
    Oct 26, 2011
    Messages:
    271
    Likes Received:
    0
    thanks Jorgen
     
  13. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    You're welcome guys. Glad the tool came to good use. :)
     
  14. jeppejwr

    jeppejwr Registered

    Joined:
    Dec 26, 2014
    Messages:
    14
    Likes Received:
    0
    Hey guys!
    I'm in a really bad need og some rotation of som files ;)
    But the exe wont open?
    I've never been using java programs og files before, so could someone please help me here? :D

    thanks!
     
  15. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Sorry for the late reply, I don't visit this forum as often as I used to.
    Anyway, post #6 is a description of how to use the tool. It's just an executable jar file, so you need a Java JDK or runtime installed in order to run it. And just to clarify, it's run from a command prompt window (Aka. "DOS shell") which you launch by pressing Win/R and then typing "cmd". (without the quotes)
     
  16. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Great tool! Nice job!
     
  17. fab06

    fab06 Registered

    Joined:
    Nov 23, 2015
    Messages:
    166
    Likes Received:
    378
    very usefull ..

    thanks Jorgen and thanks marcel too ;)
     
    Last edited: Jul 18, 2017

Share This Page