Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best practice for mass-object instancing along 100km spline (railways) plus streaming
#7
(09-13-2019, 12:12 PM)bs@vectorvision.de Wrote: first up thank you very much for the clarification and script example!
You are welcome

(09-13-2019, 12:12 PM)bs@vectorvision.de Wrote: We are now trying to adjust the instanciation script in a way that it places the instances at the same location as the spline points -currently they start at 0,0,0 world coordinates.
Just convert the positions from the spline's local space to the global space, using the spline's transform method TransformPoint

(09-13-2019, 12:12 PM)bs@vectorvision.de Wrote: Personally I'd prefer to take out all those in-between steps: find a tool that takes the georeferenced .dxf AutoCAD files and converts the spline in there into JSON format for direct curvy input. So far I haveen't found anything that can do this yet.
I must admit that I am a complete noob when it comes to the software and formats you are referencing. You will probably not find a ready made tool, but (assuming a prior knowledge of the dxf format and/or scripting inside AutoCAD) making the converting script should be easy, especially that your splines are linear (no Bezier handles to carry about)
Here is an example of a linear spline with 3 CPs
Code:
{
   "Array": [
       {
           "Name": "Curvy Spline",
           "Interpolation": 0,
           "ControlPoints": [
               {
                   "Position": {
                       "x": -6.764999866485596,
                       "y": 46.47700119018555,
                       "z": 8.006999969482422
                   }
               },
               {
                   "Position": {
                       "x": 2.3410000801086427,
                       "y": 46.47700119018555,
                       "z": 19.66699981689453
                   }
               },
               {
                   "Position": {
                       "x": 9.489999771118164,
                       "y": 46.47700119018555,
                       "z": 13.96500015258789
                   }
               }
           ]
       }
   ]
}


(09-13-2019, 12:12 PM)bs@vectorvision.de Wrote: Is this the optimal workflow or could we do the resampling in curvy (going down from 2m point distance to 60cm for the instancing)?
You can define the sampling distance in Curvy. Please read this: https://curvyeditor.com/documentation/splines/cache#the_number_of_cache_sample_points
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: Best practice for mass-object instancing along 100km spline (railways) plus streaming - by _Aka_ - 09-13-2019, 12:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: