MAX script Spline Track Maker

Discussion in 'Track Modding' started by Mario Morais, Nov 20, 2012.

  1. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    Thanks..


    The "pro version" will have:
    - Open and Close tracks.
    - Interpolation Cambers (left and right) in degrees and percentage.
    - Correct Spline mapping.
    - Spline vertex Clipboard
    - Auto detection select Spline and vertex (select a cross spline and get cambers and widths in real-time)

    the track generate the mesh on the fly it uses the modifiers stack.
    Only when have the track finish collapse the stack.

    Soon i made a video to show the complete process and features.
     
    Last edited by a moderator: Dec 3, 2012
  2. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    what price will your "pro Version" package of scripts be at?
    I would buy it, if you can adjust the width of the track for a defined crosssection. Many tracks have a broader Start/finish straight and narrower rest of the track
     
  3. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    the script already do that :)

    Can select crosssections and change width and camber for the selected.
     
  4. mkilner

    mkilner Registered

    Joined:
    Jan 13, 2012
    Messages:
    88
    Likes Received:
    1
    I tried opening and running this script from the Hammer tools menu, Nothing happens, also tried putting the file in Scripts, Startup but still nothing works, Im running Max 2009!...Help!
     
  5. aidylad

    aidylad Registered

    Joined:
    Aug 2, 2011
    Messages:
    46
    Likes Received:
    1
    1 person likes this.
  6. mkilner

    mkilner Registered

    Joined:
    Jan 13, 2012
    Messages:
    88
    Likes Received:
    1
  7. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169


    This is a Macro script just drag and drop in viewport and go to “customize user interface” and look in “Category:MMtools” and drag into a menu or toolbar.
     
  8. vicent-sollana

    vicent-sollana Registered

    Joined:
    Jan 21, 2012
    Messages:
    416
    Likes Received:
    17
    Hi, Mario.

    I want to re do Toban's roadmesh completely, I've imported the center line with your Gmaterial tool and now I want to use this script to create a new roadmesh. Everything ok 'till here, my problem comes when I try to apply the material over the road, it doesn't appear to change the texture, I still see the default one. What can this be? Do you know how to fix it?

    Thanks
     
  9. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    The surface Modifier don't create UV map coords.
    Need to apply Spline mapping.
     
  10. vicent-sollana

    vicent-sollana Registered

    Joined:
    Jan 21, 2012
    Messages:
    416
    Likes Received:
    17
    Thanks mario, i've found a tutorial to do it,thanks.
     
  11. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    Apply UV map after Collapse Spline_Track.

    Spline map need a UVW X-form modifier to scale uvw map. Then need somes touchs ( align vertex) in unWrap.

    I'm trying a script to making all automatic but no time :-(
     
  12. vicent-sollana

    vicent-sollana Registered

    Joined:
    Jan 21, 2012
    Messages:
    416
    Likes Received:
    17
    Thanks Mario for the tips but i need more practice on this, it's very frustraiting for me because i did in one time and then couldn't repeat it,:)
     
  13. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    merge tracks

    [​IMG]

    [​IMG]
     
  14. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    Pro Version

    Full options
    "Create Track", "Edit Track" & " Vertex Clipboard and UV map"

    [​IMG] [​IMG][​IMG]
     
  15. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    looking good! Where can one buy it, and how much is it?
     
  16. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    The register system is under development but will soon do tests.
    The registration system will be online and every single person will have a unique register key and can not use on another computer.

    This tool will meet who have CAD plans or other information of a real circuit.

    about the price is not yet set. Accepted serious proposals for a right price ;)

    The Registering is a way to ensure that my work is adequately rewarded. I do not intend to get rich!
     
    Last edited by a moderator: Dec 15, 2012
  17. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    :) i do have CAD plans of a real circuit.
    About the price: i would pay you between 5 to 10 Euros for this.
    BTW: Have you thought about making an "optimize" tool for this? I think of a tool, that adapts the length of the polys according to the curvature of the center line. You could pick thresholds (a maximum poly length and a minimum poly length) and then choose, at what change of direction the tools will produce another vertex.
    For an example: you could choose that polys should be between 1m and 5m long. and you could choose, that the tool places another vertex, when the centerline has changed it's direction 2 degrees compared to the last vertex point.
    I hope you understand what i mean :D Maybe another way of explaining:
    you start at one vertex point on the spline. this point has the normalized (the length is 1) tangent vector t. then you proceed along the spline, until the new normalized tangent vector of the spline - lets call it s - is at the angle to the vector t, which the user has chosen. the angle is evaluated as follows: angle=arccos(t*s) . Arccos is the inverse funktion of cosinus, t*s is the scalar product of the two vectors, and the evaluation only works for normalized vectors.
    Now every time that angle goes over the value, that the user has chosen, the tool places a vertex on the spline, which in the end defines the length of the poly at that point. however the tool never lets the distance between to vertices get bigger or smaller than the threshholds, which the user has chosen.
    This would be a great addition to your tool. This way we could quickly optimize the polycount of the racesurface.
     
  18. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169

    interesting
    can you do a image to see the vectors to explain better?

    The poly count is create by the surface modifier.

    currently have tried to optimize the turns to avoid problems in UVmap
     
  19. JJStrack

    JJStrack Registered

    Joined:
    Dec 23, 2011
    Messages:
    469
    Likes Received:
    9
    View attachment 5188
    Did it in good old Paint :rolleyes:
    The black line is your center-spline.
    The green arrow is the first vector, coming from the first red dot. the red dots are the vertices.
    In the first vertex, the direction of the spline is tangent to the green vector. Your script would now go along the spline, in maybe 0.1 m steps, and analyse the direction of the spline in that new point. In my picture the direction in the new point is the blue arrow. now your script would go further in these 0.1 m steps, until the angle between the vectors - in my picture represented through the orange arc - would be bigger than a value, which the user defined. At that point, the script places a vertex on the spline.
    now the polygon would start at the first vertex and end at the second (at least thats the case when you Loft a track, and set the path steps to "0" ) That way you could define a "resolution" at which curves are modeled in your track mesh.
    For an example, if the user says, that the angle between two polygons should be 2 degrees, the track mesh would divide a 90 degree turn into 45 polygons. That way your poly count would be optimized, if the user knows, what angles between polygons can be felt and seen in RF2 - you would never see strange angles in corners, and you would never feel angles in elevation changes, but the poly count would still be low.
     
  20. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    Like this

    [​IMG]

    thanks JJStrack maybe can help in turn fix.
     

Share This Page