Itoo Software Forum

Author Topic: How to Alternate Placing of Geometry?  (Read 666 times)

leejk

  • Newbie
  • *
  • Posts: 15
How to Alternate Placing of Geometry?
« on: June 23, 2023, 03:53:41 AM »
Hello,

So I have a spline that represents the center of a road, and I want to use it to place street lights along both sides of the road, but alternate them on each side of the road. For example, after first light is placed on right side of road, the next is placed on left side of the road at a spacing I choose. I am new to using RC so need a push in the right direction. I assume this can be done with a L1S but seems like some sort of logic will need to be created?

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2486
Re: How to Alternate Placing of Geometry?
« Reply #1 on: June 23, 2023, 09:47:04 AM »
Hi,

There are many possible setups – for example using two Linear 1S1 Generators – one with a positive Y Offset value, the other with a negative Y Offset value, and the corresponding X Offset value (a middle of the distance between these Segments). Please find attached the sample scene (XOffsetSampleScene).

I hope that helps.

Best regards,

leejk

  • Newbie
  • *
  • Posts: 15
Re: How to Alternate Placing of Geometry?
« Reply #2 on: June 23, 2023, 02:19:51 PM »
Thank you, a pretty elegant solution!

leejk

  • Newbie
  • *
  • Posts: 15
Re: How to Alternate Placing of Geometry?
« Reply #3 on: June 26, 2023, 06:10:06 PM »
Hello again,

So after putting the solution into practice I discovered some issues. The streets don't run in true X & Y orientations so maybe that is why. I adjusting the X offset on the generator that does not use it, but that did not help any really. There is a center of the street spline that is driving the lights, and that also may not be ideal either because in the circle areas, the lights should go around those as well, and by using he centerline spline they will not. The centerline spline is driving the street positions, and the idea was that it would also drive the light placement, but now thinking that may not work for all situations. I have attached a sample scene. Any ideas?

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2486
Re: How to Alternate Placing of Geometry?
« Reply #4 on: June 27, 2023, 09:28:31 AM »
Hi,

I see. In this case, driving X & Y Fixed Translation values instead of using the Offset feature of the whole Generator works better. Please find attached the modified scene (230627_street lights_iToo.max).

Best regards,

leejk

  • Newbie
  • *
  • Posts: 15
Re: How to Alternate Placing of Geometry?
« Reply #5 on: June 27, 2023, 03:15:00 PM »
Thank you, that distributes very nicely.

Additional problem now; can't get distributed lamp posts to sit on terrain correctly. The splines that represent the streets sit above a terrain mesh. In both the generators I have wired this terrain into the Surface property to make the lamp posts sit on the terrain. This method works fine for the conforming the street curbs and pavement, which is in another RC object, but for this it is causing some lamp posts to sit above the terrain, some below. Same results with the Box shape used in the test scene, so don't think the problem is with the segment geometry. I can't see where the style would affect the Z position or rotation in any way so unsure what is causing this. I did look at each transform operator's alignment options, but nothing there would solve it.

The last piece of this will be to distribute VRay lights in each of the lamp posts. Before trying to conform to the terrain I experimented with that by combining the light and lamp post geometry into a Compose operator, but the lights where not positioned correctly. The lamp post is just a Chaos Cosmos object. Is there a tutorial on this technique?

« Last Edit: June 27, 2023, 09:55:58 PM by leejk »

leejk

  • Newbie
  • *
  • Posts: 15
Re: How to Alternate Placing of Geometry?
« Reply #6 on: June 28, 2023, 02:32:30 PM »
It looks to me like these 2 Transform operators are causing the segments to not sit on the surface correctly. If I plug the segments directly into the generators, they sit correctly on the surface but then are not distributed correctly of course. You can reproduce the behavior by adding a plane with a noise modifier to generate hills as a surface to the sample scene. Perhaps a bug here?



Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2486
Re: How to Alternate Placing of Geometry?
« Reply #7 on: June 28, 2023, 04:01:29 PM »
Hi,

Please find attached a slightly different setup - using the Array 2S1 Generator instead (with Top & X Evenly Inputs). Regarding the question about lights – using a Group should do the job.

I hope that helps.

Best regards,

leejk

  • Newbie
  • *
  • Posts: 15
Re: How to Alternate Placing of Geometry?
« Reply #8 on: June 28, 2023, 05:24:07 PM »
Thank you Michal that works. Can you explain why a 2S generator had to be used?

Regarding the lights, with grouping I get the same issue; the light itself moves out of position. I made sure that the light pivot was centered on the light before I grouped it with the lamp post. If the light pivot was aligned with the group pivot, then it was placed in the same location, at the bottom of the map post. But for some reason when the pivot is not at the group's pivot position, the light itself is being shifted out of position. See image below that shows original light on the right and RC light on the left. I saw a post on this that makes it sound like there's not a good way to do this?

As a side note, being that the lamp post geometry was from the Chaos Cosmos library it was a VRay Proxy. That would not work correctly with RC, as it would not align vertically correctly. I tried adjusting the Segment Deform settings, but they did not help. I had to instead extract the mesh and use it directly. So not sure if that is expected behavior or not.

leejk

  • Newbie
  • *
  • Posts: 15
Re: How to Alternate Placing of Geometry?
« Reply #9 on: June 28, 2023, 08:06:15 PM »
Got it working although don't quite understand the why. See attached. In the end the stepped alignment option was what worked for me. Seems like this would only apply to the Z direction but in this case, it applied to the X & Y of the light for some reason.