Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: Lars Egerrup / LKE Design on September 23, 2024, 01:08:19 pm

Title: Traffic Light Style - Distribution Issue
Post by: Lars Egerrup / LKE Design on September 23, 2024, 01:08:19 pm
Hi there,

I am in the process of making a kinda automatic traffic light distributor for intersections.

I have, however, a distribution problem. More about that later, first some background  behind the style.

Most normal (read not advanced) traffic lights in Denmark are placed more or less in a square having direction lights in each corner with the same light fx red in the diametral corner. Most often the lights that for cars have a set of lights (red / yellow / green) on each side of a post pointing along the traffic direction - and a pedestrian light (Red / Green) pointing perpendicular to the direction - pointing to the street side. At the same time there is an additional light for the pedestrians pointing the other way. In other words each corner have a sequence of car light / Pedestrian  and  add. pedestrian. In the center of the square, there is a hanging traffic light consisting of 4 sets of  R / Y / G pointing in each direction.
I suppose that is pretty standard globally, right?

So my idea is to have a rectangular path with that have a linear distributor that put a sequence of two light posts in each corner (car / ped and ped) with a set distance from the corner in both directions. And an Array distributer to place the hanging traffic light in the very center of the rectangle. The style consists of 5 segments, - Car/Ped direction A, Ped Direction A, Car/Ped Direction B, Ped Direction B and then the hanging for both directions.

As the linear distributor can have only one object per corner, I have to trick it to see two objects as one, by using the compose (group) node. So I have made made a sequence of four (in reality only two) compose nodes that should distribute the light posts right +/- the set distance from the corner.

I have made a Multisub Material that consists of all the involved materials, - but most important, I have made a light sequence that handles the rhythm of the light colors of the various lights. this is done using a number of linked Select material nodes ensuring that the right color is synchronized for all the lights at any time.

Now to my issues ….

1) The distribution of the two posts works fine for the three of the four corners. But it doesn’t work for the first / Last (the one with the yellow vertex). When it reaches the vertex it just continues in the same X direction as the previous one. It doesn’t bend along the path as intended. I can imagine that the problem is that I am starting a new round, which the style can’t figure out how to handle.
How do I crack that?  I have tried various solutions, fx. to start with a single post and end with a single post, - but it doesn’t make any difference. I have also tried to have it as two linear distributors. One for the negative distance from the corner and one for the positive. No change.
Help!!  - do you have a workaround?

2) another thing I would like to do, is to distribute wires from the hanging traffic light, from the center to each corner of the path. The thing here is, that the rectangle not necessarily is square but can be stretched in on of the directions, giving a not 45 degree angle.
Is there a way to ensure it hits the corners - and are there a way to calculate the right scale (length) of the wire.

I have attached the setup, the style, as well as the material setup.

I am using 3DS MAX 2025 / RailClone Beta 6.2.2b and corona renderer 12.

Sorry for the long post  - ;)
Cheers, Lars
Title: Re: Traffic Light Style - Distribution Issue
Post by: Lars Egerrup / LKE Design on September 23, 2024, 01:35:20 pm
OK, I have made a semi solution for the 1st issue.
If I make an extra vertex in the middle of the one of the sides of the rectangle path  - and tell the style to put an empty (yet scaled) segment in this position, it makes the corners right.
I would prefer thought that I shouldn't add another vertex - and only have the 4 corners to deal with,  as it can make issues for future more advanced setups, where I will need more vertices around.
So best case scenario, would be without empty vertices.

ARe there any way, I can reach into the corona material selector "switch" from within RC?
Title: Re: Traffic Light Style - Distribution Issue
Post by: Paul Roberts on September 25, 2024, 03:36:55 pm
Hello Lars,

I'm afraid at present RailClone can't affect the parameters on other objects in the scene. The only way I could think of to do it would be to manipulate the material IDs using the Material node. Is that something that might be an option?

Many thanks,

Paul
Title: Re: Traffic Light Style - Distribution Issue
Post by: Paul Roberts on September 25, 2024, 03:56:39 pm
I've taken at a look at your corners issue. Please see the attached sample, maybe that can work for you?

Many thanks,

Paul
Title: Re: Traffic Light Style - Distribution Issue
Post by: Lars Egerrup / LKE Design on September 26, 2024, 03:46:11 pm
Thanks Paul,
Seems like this is the way to do it.  I hadn't thought of using an empty segment as "the pusher"  - very smart.

So soon I will  have a totally parametric road / Pavement / Street light / Traffic light / Road markings / Car  distribution style . I've attached some WIP images.