|
Jewel posted:It's not the sleepers that's the deformation, I know they'll always deform and it's not realistic, I'm talking about at the 45 degree angle the exposed end of the track is all squashed and short. Though that endpoint tracking + thickness idea is neat. Translate the midpoint of the exposed end instead, and calculate the track positions off of that? Same basic idea as beta's recommendation for the sleepers. You only have two points that are free: the centers of the tracks at either end. Everything else should be calculated from those. What are you generating those curves from? EDIT: The variables I'd use are the center points of the track at either end and two vectors specifying incoming and outgoing directions, and then constrain the tracks to follow a circular arc.: 1. Calculate the radius and center of the circle from the two points and directions. 2. Add or subtract the separation of each line from the center arc. 3. Draw circle arcs of those radii with the same center and subtended angle as the center's arc. A straight track segment has an infinite radius, so you'll need to special case it. EDIT2: Like this. The Laplace Demon fucked around with this message at 07:29 on Dec 27, 2014 |
# ¿ Dec 26, 2014 23:54 |
|
|
# ¿ May 3, 2024 16:33 |
|
baka kaba posted:Yeah this was what I was getting at - treat the midline for each sleeper as between two points, one on each track line, and let the function move the points. You end up with a rotated line and you just need to align the sleeper with that. I guess the slight complication is that tight turns with short spacing will end up trying to cram several sleepers into the inside turn, and you might get overlaps. Thanks! Here it is with sleepers added the way you were describing. The Laplace Demon fucked around with this message at 18:40 on Dec 27, 2014 |
# ¿ Dec 27, 2014 18:29 |
|
Nah, it's more analogous to DBL_MIN. Mozilla's example for how to use it is delightfully obscure: Using MIN_VALUE posted:The following code divides two numeric values. If the result is greater than or equal to MIN_VALUE, the func1 function is called; otherwise, the func2 function is called. I guess you know why you might want to do that if you already knew about MIN_VALUE, but absent that context it as might as well be any other constant, e.g. JavaScript code:
Hmm, I wonder if there's an example on Math.SQRT1_2's documentation page? Using Math.SQRT1_2 posted:The following function returns 1 over the square root of 2:
|
# ¿ Apr 17, 2017 18:13 |