1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
Like RaceDepartment on Facebook.

world coordinates of tracks

Discussion in 'Racer' started by Shun Sasai, Jun 8, 2014.

  1. Could somebody please teach me how to know the world coordinates of a track? I have to use a car position in a track. I know that we can easily know that as "u" in log files, although log files in old version (v0.5.4.3 for Mac) does not have "u" in it. Any information would be appreciated.
     
  2. What exactly do you want to know?

    The car position in world coordinates? Or where the track origin is?

    Dave
     
  3. Thank you so much for your consideration, Dave.

    I would like to know the lateral position of car on the track. I'm using a track where there are two lanes divided by a yellow center line, and I would like to measure deviations from the center lane during driving. The track was downloaded via internet (http://www.xtremeracers.info/web/in...&Itemid=63&view=viewdownload&catid=20&cid=872).

    The lateral position of car could be obtained as an index "u," if you used newer version of Racer. However, there is an error in back ground scenery, and I could not find the way to fix it. Also, there is nice smoke in newer version, although I would like to remove the smoke effect (I also don't know how to fix it). Attached figures are instances (upper for back ground, lower for smoke). Therefore, I gave up using new one and am looking for the way to calculate deviation by using both car position in world coordinate and that of center line of the track.

    Shun shadow1.png smoke1.png
     
  4. OK so you want a live readout of the lateral position on the track that you can then use elsewhere... does it have to be logged or real-time?

    Thanks

    Dave
     
  5. Stereo

    Stereo
    Premium Member

    The problem with the background is cause of the skybox, it's a bit of work to update (easiest way is to copy the one Carlswood uses, but it lives in ~5 files)
     
  6. Dear Dave,

    Exactly. I'll analyze the lateral position after I played simulator, so I need a record of that such as a log file.

    Shun
     
  7. Dear Stereo,

    thank you so much for providing the information. But...could you please give more information of that? Usage of Carlswood one is fine for my aim. But I don't know which files I should move to which directory...

    Shun
     
  8. Stereo

    Stereo
    Premium Member

    From \data\tracks\carlswood_nt
    sky_clouds.tga
    sky_night.tga
    sky.dof

    Copy those to the new track folder, then in the new track, open track.shd and add or replace:
    Code:
    vf_sky
    {
      vertex_shader
      {
        ;file=sky_daynight_v.cg
        file=sky_v.cg
      }
      fragment_shader
      {
        ;file=sky_daynight_f.cg
        file=sky_f.cg
      }
    }
    
    shader_sky~vf_sky
    {
      sky=1
      cull=none
      compression=0
      layer0
      {
        map=sky_clouds.tga
        depthwrite=0
        depthfunc=always
      }
      layer1
      {
        map=sky_night.tga
        depthwrite=0
        depthfunc=always
      }
    }
    (if the 'shader_sky' section exists replace it)


    and in the new track's geometry.ini add/replace
    Code:
      sky01
      {
        file=sky.dof
        flags=0
      }
    You can open the geometry.ini of Carlswood to see where it goes if you need to.
     
  9. Dear Stereo,

    many thanks for your help and kindness! I could fix the background by following your instruction!! I'm really glad to do it. Thank you so much!

    Shun