Object generation utility

  • Maybe an easier option would be to detect other nearby traffic_signals and use those additional nodes to determine orientation:


    4 signals in a group = 90 degrees difference for each one

    2 signals in a group = 180 degrees difference

    1 signal = default North-South

  • Hello Ken,

    an interesting idea.

    As far as I know, lights can only be defined in a TOC file.

    If Stu likes the idea, he could create a toc together with the tsc file (and include the toc call).


    I played a bit with traffic lights, with the aim to have an automatic switching between green - yello - red.

    With the below lines I managed to get a 22 sec green, 2 sec yellow and 22 sec red phase. The disadvantge is, that scenproc then only generates the same signal colors for the whole city. And random color is not possible; otherwise the signals would not sequence the colors.


    # Traffic signals

    CreateAF2Light|highway="traffic_signals"|1.0;0.0;0.0|5|0.15;0;6|5

    CreateAF2Light|highway="traffic_signals"|0.0;1.0;0.0|5|0.15;3;6|5


    But with Stu's program he maybe could assign the following:


    All streets in E-W direction which have the attribut highway="traffic_signal" get this light:


    and all streets in N-S direction which have the attribut "traffic_signal" get that light:


    Optionally the toc generation could also take care of lights assigned to a model:

    high chimneys, wind generators, railroad crossings and signals ...


    What do you and Stu think?

  • Traffic on motorways. Autogen on every node.



    To all 3D modellers: we need low/medium-poly count 3D models for cars and trucks! (N-S orientation)

    Offset for cars, left lane: 0.9m

    Offset for trucks, right lane: -0.8m




  • Tom, one possible solution for the traffic signal problem would be to use 2 TOC files (red & green).


    - run scenProc for all red lights with a 30-sec "on" time and a random delay generated for each one (10sec, 20sec, or 30sec)

    - copy that "red" TOC file and rename it the "green" TOC file

    - then do a find/replace on 10sec --> 40sec, 20sec -->50sec, and 30sec --> 60sec


    Granted, the signals at a common intersection won't be coordinated but the illusion from the air is probably good enough for the time invested.

  • It looks like traffic signals are just Nodes but those Nodes are included in a street Way.

    If the node is referenced from a way it will be treated like the power pylon or ski lift and the orientation will be calculated from the way

    Seems like it would need 2 levels of parsing, one to get all the traffic_signals Nodes, and a second to find those same nodes in street Ways.

    Reverse order.

    Ways are processed by walking along the way and processing any nodes referenced from the way.

    If Stu likes the idea, he could create a toc together with the tsc file (and include the toc call).

    Roadmap item


    As long as there is a generic way define lighting specification.

    I don't want to code a special case for traffic lights.

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • Tom, I took your 22-2-22 green/yellow/red traffic light timing numbers and duplicated them and shifted them a half cycle and then added a FRAND branch that randomly assigns the original or shifted timing to each traffic_signals node in your osm file. This creates the illusion for 2-light intersections that are assigned an orig & shifted that the 2 lights change in sync from red-green and green-red.

    Code
    1. # Traffic signals
    2. CreateAF2Light|highway="traffic_signals" And FRAND<=0.5 |1.0;0.0;0.0|1|0.15;0;6|5
    3. CreateAF2Light|highway="traffic_signals" And FRAND<=0.5 |0.0;1.0;0.0|1|0.15;3;6|5
    4. CreateAF2Light|highway="traffic_signals" And FRAND>0.5 |1.0;0.0;0.0|1|0.15;3;6|5
    5. CreateAF2Light|highway="traffic_signals" And FRAND>0.5 |0.0;1.0;0.0|1|0.15;6;6|5


    A quick VR test flight made me think the transitions need to be faster, maybe 11-1-11 . This may seem too short, but with all the other streetlights I think the red-green transitions need to be quicker to catch your attention. I'll continue the experiments.


    Ideally, we'll be able to plant traffic signal poles at the intersections with the lights at the right height and spaced appropriately but that will probably require a parser routine to detect close traffic signals in the toc file and output additional toc files with adjusted coordinates for the other lights as well as matched timings.


    The best we can do short-term is to expand on the FRAND approach above to go from 2 random groups to 10 random groups. With faster timing, the 1-light intersections would function normally, but the 2, 3, and 4 light intersections would have random changes occurring.

  • Hi,


    I found a set of really low polygon cars at 3D warehouse.

    So I can provide about a dozen different types with any kind of color, if you don't find them too ugly.

    I just have to recompile them since I missed the offset.


  • I just have to recompile them since I missed the offset.

    This would be very nice, Rodeo.

    Please orient them as:

    (N-S orientation)

    Offset for cars, left lane: 0.9m

    Offset for trucks, right lane: -0.8m

    so all PKW will drive on the left lane and all trucks on the right (not nice, but reallity here ;-) )


    Can you add the 3d warehouse links each please, so we can officially distribute them ?

  • Uploaded new release of ObjectGen


    Major change is a new SelectionExpression capability to allow compound selection conditions to to specified instead of simple AndCriteria

    Added general expression evaluation engine to evaluate the result of the expression.


    Some other smaller updates.


    See readme and UserGuide for details


    /Stu

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • Tom, here are ScenProc lines I settled on for the traffic_signals random changes that I added to the South Florida TL add-on update (V2) ...


    Code
    1. # Traffic signals
    2. CreateAF2Light|highway="traffic_signals" And FRAND>=0.0 And FRAND<0.25 |1.0;0.0;0.0|5|0.25;0;6|5
    3. CreateAF2Light|highway="traffic_signals" And FRAND>=0.0 And FRAND<0.25 |0.0;1.0;0.0|5|0.25;3;6|5
    4. CreateAF2Light|highway="traffic_signals" And FRAND>=0.25 And FRAND<0.5 |1.0;0.0;0.0|5|0.5;0;6|5
    5. CreateAF2Light|highway="traffic_signals" And FRAND>=0.25 And FRAND<0.5 |0.0;1.0;0.0|5|0.5;3;6|5
    6. CreateAF2Light|highway="traffic_signals" And FRAND>=0.5 And FRAND<0.75 |1.0;0.0;0.0|5|0.33;0;6|5
    7. CreateAF2Light|highway="traffic_signals" And FRAND>=0.5 And FRAND<0.75 |0.0;1.0;0.0|5|0.33;3;6|5
    8. CreateAF2Light|highway="traffic_signals" And FRAND>=0.75 And FRAND<=1.0 |1.0;0.0;0.0|5|1;0;6|5
    9. CreateAF2Light|highway="traffic_signals" And FRAND>=0.75 And FRAND<=1.0 |0.0;1.0;0.0|5|1;3;6|5


    I also experimented with 3D traffic signal pole objects being placed at each traffic_signals node using ObjectGen but there's currently no orientation control and the poles aren't really noticeable above 500 feet anyway. Highway street light poles might be a better investment in time/effort to get the orientation right.