challenge

Started by Dune, March 18, 2014, 12:47:04 PM

Previous topic - Next topic

j meyer

Ulco,do you need the exact measures for an infinite length (of track) ?
Or just a predefined length,e.g. a short straight and 1 or 2 curves?

Approaching this problem from a graphical/geometrical point of view suggests
that the warping method TG uses can't give the wanted result.
To have an accurate curve you'd need at least an outer radius and an inner
radius and you don't get these by warping,not even with hetzens parallel warp.
Not to mention the changes of direction.

Maybe time to consider a modular system or so.


bobbystahr

For RR tracks and the like the ideal would be to be able to populate along a path(which we don't have yet)as that way just one small mosel of the track could be built and populated like in other apps, well at least my old modeler Imagine...missing it a lot lately it seems.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Dune

#17
Yes, populate along a line would be a good feature as well, also for lines of trees along roads for instance. And pylons for monorails.

And @Jochen: no, actual measures are not the most important, but nice to get near. But if there is a way to calculate it, it would be for the whole track, I assume. Until now I kept my POV such that it was just above an area of track which went kind of straight North or West, but as soon as you'd want to animate and travel along a winding railway, you'll see the still parallel sleepers while the track is making a bend. So if the angle of a warped track (that's the easiest way to bend it) can be translated into a localized rotation.....

I didn't call it a challenge without it being one  ;) But it's not that I really need it; it's just that I want to get further than possible, as always.

mogn

The easy part, the Railway ladder.

mogn

The modified ladder.
Not good enough, the sleepers are disturbed, due to their Width.


Dune

#20
Well, you are getting really close  :D  In fact the bends may be a lot softer, so the width 'problem' may be no longer a problem. I'll check this out.

Checked it out. Great. If you replace the get... geometry by a get... texture you can resize it to actual needed size. Maybe possible elsewhere, but this was easy. Can this work with another warping method (like my file), mogn, instead of the perlin 3D way?

bobbystahr

amazing...mogn's the man
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

j meyer

The last file mogn provided looked very promising,so I downloaded it
to give it a try.Unfortunately it turned out to be as useless as all of
our previous attempts.The only thing that is really better is the spacing
of the sleepers (sticks).
For the image I've just replaced the "get pos..." with a "get p ..in texture"
and scaled it down 10 times and then moved it 150 m along the z-axis.
So it's still the same network.

[attach=1]

As you can see here and more clearly when you disable the stripes the warping
shows the same shortcomings as all the other approaches.

We need a method to bend a stripe/band where we want and how much we want.
And it needs to be a stripe/band not a line without dimension.

As an addition to the suggested spline/path thing,how about a virtual bulldozer? ;)
We could build even serpentine roads.


Dune

Too bad. In this screendump you can see how warping works (for those who don't know) and immediately recognize the problem. Although it might be possible to use the grays from the warping fractal (testcolor; purple = white, no purple = black) for a rotation of the sinus driven lines, they will not all be rotated right. The blue and red stripe need opposite rotation, but the gray is the same value at those points. And at the white and black areas the rotation should be zero.

j meyer

The warp shader seems to be the wrong tool for this task,at least imo.

I think we need someone who is capable of constructing a formula that
can bend a stripe.That would have some minor shortcomings,too.
Namely wedge shaped sleepers.
That wouldn't solve everythingelse,but it'd be a start.

[attach=1]
This illustrates bending

[attach=2]
This illustrates the ideal (just the principle)

Furthermore we would need a way to define the course and where to put curves,
define the radii thereof,keep the sleepers perpendicular to the centerline of the
course/track.Or in other words : a good programmer is needed.
If you think about it,you may find that I roughly described something that is
similar to a spline/path.....oh well.

Waaayy beyond my mathematical capability.
And constructing this from SimpleShShs,....hahaha... no way.

Dune

Agreed, it is hard, and way beyond me as well. Nice schedule though, but I wouldn't worry too much about 'wedginess', as a railtrack wouldn't go round that short. I keep my hopes on mogn or another skilled mathematician....

bobbystahr

Quote from: Dune on May 07, 2014, 11:27:15 AM
Agreed, it is hard, and way beyond me as well. Nice schedule though, but I wouldn't worry too much about 'wedginess', as a railtrack wouldn't go round that short. I keep my hopes on mogn or another skilled mathematician....

agree, even on a major curve' the circumfrence they'd follow would have a wide gentle curve.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

mogn

#27
Quote from: j meyer on May 07, 2014, 11:11:51 AM
The warp shader seems to be the wrong tool for this task,at least imo.

I think we need someone who is capable of constructing a formula that
can bend a stripe.That would have some minor shortcomings,too.
Namely wedge shaped sleepers.
That wouldn't solve everythingelse,but it'd be a start.

[attach=1]
This illustrates bending

[attach=2]
This illustrates the ideal (just the principle)

Furthermore we would need a way to define the course and where to put curves,
define the radii thereof,keep the sleepers perpendicular to the centerline of the
course/track.Or in other words : a good programmer is needed.
If you think about it,you may find that I roughly described something that is
similar to a spline/path.....oh well.

Waaayy beyond my mathematical capability.
And constructing this from SimpleShShs,....hahaha... no way.

This is actual easier than construct the sleepers along a random curve.
The danish Railways specifies a minimum radius of 600 m.
With a distance between the sleepers 52.5 m this gives an angle between the sleepers of 5.013381
degrees = 0.087500 radians. Each sectors (slice) of 0.087500 radians is numbers 0..72.
If you applies atan2(z,x) to the current point from the get function, you can calculate which slice number
the current point belongs to.
Then you rotates the current slice to slice number 0. Do the calculation in slice number 0.
Note that the point in the orginal slice is not changed, i.e it Works as you have done your calculation in
the original slice. (As if slice 0 is rotated back to current slice).

bigben

#28
Quote from: j meyer on May 07, 2014, 11:11:51 AM
The warp shader seems to be the wrong tool for this task,at least imo.

The masked man suggests describing sections of track mathematically so you have pieces like a train set.   ;)

Joining them up would be difficult'ish, but building the pieces would be the first step.

Constants: center of curvature, inner/outer radius of sleepers/track, start and end angles of curve.
Sine function on the angle from the center of curvature to create radial spokes at the frequency of the sleepers, colour adjust node applied to that to define the width of the sleepers multiplied by a mask for inner/outer radius of sleepers.
The sleeper would not be rectangular, but at a radius of 600m they'd be close enough.

Straight sections of track could be trickier (when not along X or Z)
[EDIT] Straight sections: 
What we know: Position of end of the track, tangent to the track curvature at the ends (direction the straight track should go).
Using a similar approach, sine function of X or Z to define spacing of sleepers, rotate to match tangent, colour adjust to define edge of sleepers, transform to fix spacing of sleepers at the join, mask with SSS to define ends of sleeper and length of track. Sounds possible.

You'll also want a gradated radial mask parallel to the track so that you can create different track features (distribution of rocks, raising track above terrain), but the basic building blocks would be similar.

[/EDIT]

Dune

Sounds promising, but please now in real language = TG language  ;)  I'd prefer a way to use a 'normal' warp setup, so you can make random curves, but it will still be hard to derive data from that curve I'd say. I haven't a clue about how your ideas exactly work.