2
$\begingroup$

I'm trying to create a prodecural rollercoaster. I managed to include the pillars, but I want that, in some parts, the pillars don't show up, like in a loop:

enter image description here

How can I do this?

A side problem that I have is that my pillar index are based in the spline parameter, but would be better if were based in the "planar lenght" off my rollercoaster, so that the inclined sections do not have more pillars than the straight sections. Is it possible?

My nodes for the pillar: enter image description here

$\endgroup$

2 Answers 2

2
$\begingroup$

I would solve it like this:

enter image description here

enter image description here

  1. First I create an offset of the curve to get a direction vector from the original positions and the new positions.

  2. Then I check if the angle of this direction vector compared to the vector $0, 0, -1$ is in the range of $\frac{\pi}2$.

    If it does, then it is obviously a loop. In addition, I check to see if the positions of the curve points are above a certain value to the ground. This allows me not only to detect loops, but also to avoid placing pylons where the track rests on the bottom.

  3. Next, I separate the curve segments and place their points on the ground, because this allows me to achieve a regular spacing of the pylons.

  4. The line created in this way is then converted back into a curve, and divided into segments of a certain length. With this I have once determined the positions of the pylons.

  5. Next, I create the pylons, as well as the track.

  6. Lastly, I instantiate the pylons and create a raycast from the points up to the track to capture the distance/scaling of the pylons.

$\endgroup$
9
  • 1
    $\begingroup$ Yours looks so much more grown-up.. with all that official-document, engineering-department white! :) . Fewer folks would die on yours. But they would only get 1/4 of the way up the loop before rolling back... $\endgroup$
    – Robin Betts
    Commented Jun 8, 2022 at 16:20
  • 1
    $\begingroup$ @RobinBetts Ah, I didn't mention: the slight curvature of the track comes from the fact that it is a maglev with electrodynamic drive (EDS). The passengers are stored in capsules, which are shot with zero resistance inside (!) the track until death occurs ...so no problem to keep up with the mortality rate that occurs on your track ;-) $\endgroup$
    – quellenform
    Commented Jun 8, 2022 at 17:02
  • $\begingroup$ Ahhh, I see! And there I was, thinking you'd just been too lazy to make a track profile. $\endgroup$
    – Robin Betts
    Commented Jun 8, 2022 at 17:12
  • $\begingroup$ Thank you, I learned a lot! I downloaded your blender file and tried to change the profile curve of the rollercoaster to the format that I want, that is basic tree circles. I did it, but some pylons are blowing up. I don't understand a lot about raycast, and I think that is the problem, hehe My nodes: gyazo.com/c07604c1ba01d317cd3a4702a1d95da1 What is happening: gyazo.com/3b3432819812ad9aa6d276dd24e2d930 $\endgroup$ Commented Jun 8, 2022 at 20:55
  • 1
    $\begingroup$ I solved it! Basically my problem was that I was trying to create the entire "3 circle" structure as my profile curve. I change to actually three curves, each one converted to mesh. Than I created a "false" curve that which role is just "cover" the raycast, and it worked out! Thanks for all the help! I actually have another problem to figure out, but is about rotation, so I will ask it in another question. $\endgroup$ Commented Jun 9, 2022 at 16:51
2
$\begingroup$

This example assumes the plan view of the curve-path for the roller coaster is constructed in XY, and raised to its various heights in Z. The incoming curve has its 'Twist' set to 'Minimum'.

This approach constructs another curve from the supplied path, adapted to be a base for your pillars.

  1. The parts of the curve on which the track is either very steep, or inverted, are removed, so will not spawn pylons:

enter image description here

.. discriminating by asking how aligned the curve's Normal x Tangent is aligned to object Z. If you delete/separate points from a curve, in GN, it just dissolves them. We want to delete them. That's why the curve is converted to a mesh, and back again. The mesh is deleted according to the curve's captured normal.

  1. We want to sample lengths from the curve's projection in XY..

enter image description here

.. we store the curve's Z for future use, and then scale it to 0 in Z. We sample lengths from the flat version. We can then instance the pylons on those samples, and use the stored Z, one way or another, to raise them to the correct height.

In this case, I've put simple extruded-by-0 grids on the sample points, and then ray-cast up from them, 'shrink-wrapping' the tops of the extrusions to the underside of the track, so I haven't used the stored Z...

enter image description here

You might use the stored Z. Perhaps to locate the tops of your columns, as instances, or by raising a selection-by-Z of your column-template to an offset of the stored value.

enter image description here

$\endgroup$
4
  • $\begingroup$ Oh, you were again a tad faster ;-) ...never mind, I'll finish my answer anyway, even if this is very similar to yours. $\endgroup$
    – quellenform
    Commented Jun 8, 2022 at 11:41
  • $\begingroup$ @quellenform.. Sorry, I hate it when that happens. The more care you take over your answer, the more likely that is. 2 angles on the same approach can't hurt, IMO.. :) (I'd be interested, for one!) $\endgroup$
    – Robin Betts
    Commented Jun 8, 2022 at 11:44
  • 1
    $\begingroup$ (In the mean time, I'm just trying to calculate how many people would die, if my rc was ever built) $\endgroup$
    – Robin Betts
    Commented Jun 8, 2022 at 11:49
  • $\begingroup$ Thanks for your help! I learned a lot with your comment. I still got a problem. I will write a comment in the another answer $\endgroup$ Commented Jun 8, 2022 at 20:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .