challenge

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

Previous topic - Next topic

bigben

I'll have a play on the weekend.  My math brain is occupied helping some researchers obtain the GIS coordinates of cows in a paddock from fisheye images shot by a GoPro on top of an 11m tower... They seemed equally bemused at my optimism.  ;)

Most of my job involves describing things in terms that can be passed on to a computer to do stuff. My trigonometry is a bit rusty but I think what I described is possible... not necessarily practical, but possible.

Dune

Crossing my thumbs for a nice outcome, Ben. Thanks!

bigben


Dune

There are a lot differences between regions and countries regarding sizes of sleepers and rails. Interesting read.

j meyer

mogn - thanks for the reply.Unfortunately I'm not able to understand what you
          wrote.

bigben - Seems like you are describing in a more scientific way what I was hinting
            at with my lay babble.(modular system etc)
            As you said not necessarily practical,but possible.
            Or why use an image map when it's possible to do it in a more complicated
            way? ;)
            Agog to see what you'll come up with.

Ulco,can you make a quick tutorial on how to cross thumbs,please? ;D ;)

Dune

Didn't you know? I have 5 thumbs on each hand, all pointing up  ;D (I know, I meant fingers  :P )

Ogre

I thought perhaps evenly spacing a population along the surface of a displaced plane rotated on its side may work.  I cannot get the objects to tip to the planes surface normal, they just tip in the Y direction
"If you find me feeding daisies
please turn my face up to the sky and leave me be watching the moon roll by.
What ever I was it was all because I've been on the town washing the BS down."

-Gordon Lightfoot

Dune

Yes, same problem, their angles should depend on the angle of the whole stretch.

mogn

#38
Quote from: bigben on May 12, 2014, 07:23:00 PM
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.


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.


The straight tracks just requires a prerotate of the coordinate system, eg a path of 23 degrees requires a rotate of -23 degrees.

mogn

My rotate rotates anti clockwice so a change to negative of the angle is not needed.

bigben

#40
OK, I had to have a preliminary play.  Here's a 500m radius circle of sleepers, 23cms wide, 13cm high, 244cm long, 60cm apart.
The approach:

  • Calculate the bearing from position to the centre of curvature
  • A cosine function of that will give you a radial gradation from 1 to -1
  • Difference from 0 of this gives you  a radial gradation from 1 to 0, with two "spokes"

  • Find out how many sleepers in half of the circle (1892.5)

  • Multiply the bearing by this and you now have the right number cycles
  • A colour adjust node creates a sharp edge to the sleeper (Cosine of the relative width of the sleeper where the width of the sleeper + gap between sleepers = 180°)

  • Length of the sleeper is then defined by boolean conditions
    • Distance from centre of curvature < radius + half sleeper length and > distance - half sleeper length (had to read up on the boolean nodes again... it's easier to follow than multiplying masks together)

or here's the TGD  ;)
There are a few unused nodes in there in preparation for adding tracks and masks for gravel and track surrounds.

[EDIT] For the 2 people that downloaded the TGD, I hadn't saved the camera position so you'll have to look for the tracks to the south east. Updating the TGD[/EDIT]

Dune

Hey Ben, that's pretty nifty! 

j meyer

Indeed!
May take a while to digest,though.(for me that is)

bigben

Thanks guys. Don't worry, I had to step through the math in a Word document because it started to. Do my head in. I've been thinking about how I can make it more sustainable/usable and I think it may be possible to connect bits of track by changing how the positions are defined.
First problem I had was how do I place the centre of a circle 500m out of camera and place the track where I wanted it in the frame. 

My initial model defines the position of the track from the centre of curvature or the centre of the straight, but if I change to calculate the centre from a position and compass bearing for one end of the track I can calculate the position and bearing of the other end of the segment and pass that on to the next piece of track. In theory it should be possible to construct a string of straights and curves in such a way that modifying the length of any piece will readjust the position of all adjoining pieces.  that would be sweet.

A little trickier is what to do with the terrain around the track. This will take a bit of fiddling outside of TG but I'm thinking an orthogonal render of the track mask with the terrain disabled to provide a base image for defining the altitude. Load this into  photoshop and add linear gradients along the track to match the changes in altitude. Blur it a bit and then use this image map to create a second terrain masked by the track area (additional mask to be added to the track model). Merge the 2 terrains and you should have a nice flat surface for the tracks to sit on with realistic gentle slopes as well as producing cuttings and embankments. If it works as well as it does in my head it will be awesome.

At least with thumbs crossed I can still type ;)

bobbystahr

Quote from: bigben on May 14, 2014, 05:56:20 PM
Thanks guys. Don't worry, I had to step through the math in a Word document because it started to. Do my head in. I've been thinking about how I can make it more sustainable/usable and I think it may be possible to connect bits of track by changing how the positions are defined.
First problem I had was how do I place the centre of a circle 500m out of camera and place the track where I wanted it in the frame. 

My initial model defines the position of the track from the centre of curvature or the centre of the straight, but if I change to calculate the centre from a position and compass bearing for one end of the track I can calculate the position and bearing of the other end of the segment and pass that on to the next piece of track. In theory it should be possible to construct a string of straights and curves in such a way that modifying the length of any piece will readjust the position of all adjoining pieces.  that would be sweet.

A little trickier is what to do with the terrain around the track. This will take a bit of fiddling outside of TG but I'm thinking an orthogonal render of the track mask with the terrain disabled to provide a base image for defining the altitude. Load this into  photoshop and add linear gradients along the track to match the changes in altitude. Blur it a bit and then use this image map to create a second terrain masked by the track area (additional mask to be added to the track model). Merge the 2 terrains and you should have a nice flat surface for the tracks to sit on with realistic gentle slopes as well as producing cuttings and embankments. If it works as well as it does in my head it will be awesome.

At least with thumbs crossed I can still type ;)

Can't wait to see the outcome of this. The technique with the terrains could be also used for roads.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist