News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Railway Lines into distance

Started by samdavo, October 30, 2013, 04:01:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

samdavo

Here's a first stab at drawing railway lines into the distance.

It's a mixture of extruding along a curve with a scaling factor along that length (100% to 5%) - and as for the sleepers, there are a few arrays, (array along a curve, or rather several arrays along parts of a long curve), all of which taper in the same way - and some juggling / trial and errors going on.

As such, the perspective is concocted.   I haven't tried to actually draw a long curving series of sleepers, all the same size, and then use perspective.   My suspicion is that it would be much more memory hungry, and less dramatic.

For discussion.
cheers. 

PS It is easy to make the sleepers get smaller into the distance, but I believe there is no easy way to make the gap between sleepers appear to get smaller.

PS I would welcome it if someone drew this "correctly", i.e. with all sleepers equally sized and spaced, and the only perspective being provided by "viewing distance etc"

samdavo

#1
Here's a similar idea.
It is a very simple way to show an extruded channel section, and exaggerating perspective by scaling the extrusion.

I have used the "approximate old-fashioned oblique view and isometric view" which is another thread around here somewhere.

Shadow and light direction are "planned" by using a "spotlight setting", which lets you gravity snap to each end of a beam of light - and then change that to "directional". 

I include 2 dcd files, one is 2D, the other 3D (front view as main view), in fact they are identical.  I quite like the 2D one, because it is easiest to convert to Bentley Microstation etc (even though the extrusion was obviously done in 3D).
cheers

samdavo

#2
Back to the sleepers for a minute.
I couldn't explain how I did that, lol. 
I found it quite difficult to fathom what was going on with handles,
and sometimes the sleepers seemed to be reversed, (upside down on the other side of the curve), or even receding into the FOREGROUND lol. 

There are some tips on F1-HELP about setting handles, but I found them pretty tricky -  and there's no example given for
a) extrude along a curve
b) keeping the sleepers normal to said curve
c) with scaling factor to give a taper

d) and I then go on to try to give the effect of the sleepers becoming closer together as they would with a long-view perspective painting.

As for handles, I might have to read Lar's "extrude along a curve" thread (which I've just noticed). 
http://forum.designcad.com/index.php?topic=4580.0

As for step d). 
I suspect that the best is to break up the curve into segments.  I chose 4 from memory, although another idea I had was to use a geometric progression of curve lengths, 
4,
6,
9,
13.5,
20 and
30. (which is pretty much what the curve at the right is,  those ratios anyway).

The other thing I am doing differently for the one at the right is to start from the back, and lay sleepers forward.  Why?  well you can stop laying sleepers when they become "big enough" to the eye, and/or you get sick of it lol.  (For the example jpegged in the first post, I started at the front with 4 equal-length segments of curve and used trial and error on scaling and number of "columns/sleepers" in each curved-and-tapering array etc).
   
For the one at the right, - and I haven't succeeded here yet (which is only known when you complete the exercise)  - I have started with the smallest curve (length 4 units) at the back, and placed first sleeper in far-distance,  (also 4 units long as it turns out ) -  then "curve-taper-arrayed" them to the front with scaling factor of 1.5, laying about 8 sleepers.
The last sleeper in this sequence is obviously 1.5 x 4 = 6  units wide.

Then for the next length of curve, I have laid 9 sleepers, scaling factor 2, hence they range 6 to 6x2=12 units long.

then (just now) another 9 with scaling factor 2.5,
then another 10 with scaling factor 3.0
then another 5 with scaling factor 1.5 only ( that's what was needed to make it look right, although the logic of the geometric progression seems to be out the window lol - I suspect I screwed up the length of this curve)

PS THere's an "oops" there - as far as I can tell, I simply clicked the wrong part of the curve (?) because when I clicked another part of the curve it seemed to work ok.   
yep that seems to be the cause.  If you click near the left hand end of the curve, you get the correct orientation of the sleepers (and the taper effect).     But if you click the right end of the curve, you get the "oops" effect - refer final jpeg.

samdavo

#3
... here's what I chose as handle (just one point repeated several times till it was happy to colour it blue/purple :)  )
and the completed set of sleepers.
cheers

PS this set of sleepers are on the right side of the curve, all others are on the left ( 2 cents)
the sleepers shown on the left are the "template" I used for the array going forward from that point.

samdavo

#4
Just trying to add some evidence to the knowledge base around here.
If you choose the handle as per the jpeg,
then if you click point 1, you get the correct set of sleepers (on this occasion), following the curve, and tapering bigger as it gets closer;

but if you click point 2, you get the incorrect set of sleepers, rotated about almost every axis, incl tapering the wrong way, etc.

"oops" above (and repeated below) was the result of using Point 2.  (2 cents).

samdavo

#5
Quote from: samdavo on October 30, 2013, 04:01:13 AM
PS I would welcome it if someone drew this "correctly", i.e. with all sleepers equally sized and spaced, and the only perspective being provided by "viewing distance etc"
ok, I've done it myself  - or rather tried to do it myself.

But I'm damned if I can get any significant perspective into it.  (2 cents)
Any assistance / comments welcomed.

PS the third jpeg uses a close viewing point (only 700,  when the "depth of view" = length of the railway line = more than 1200)  - but all it achieves is distortion (as far as I can see).

Adrian 2.0

Here you go Sam.
The 3D file attached is for a standard gauge track (1.435m ID) with 2.6m x 0.25 x 0.15 sleepers at 600mm c/c (1/2 buried in gravel)
The curve in the rack is the accepted minimum radius of 100m
my station point is 1.5m above the track & I'm standing about 5m to one side. (didn't ant to get run over by a train!)
If it's worth doing etc.......
This exercise uncovered another render bug - something I'd noticed before but never bothered to work out the cause of.
The sleepers are texture mapped with the sleeper.jpg in the zip file - box mapped & tiled as one entity.
In accelerated graphics mode I had to render it as box top to display.
In phong mode I had to change that to box front to display correctly - I think that is because I drew the track in XY plane & rotated it into XZ in 3D - the renderer does not seem to recognize the rotation in non-graphics accelerated mode.

samdavo

#7
Thanks Adrian, quite authentic - even second hand sleepers :)
Mine is obviously a zig-zag railway from a dream I had as a child.
If I can't replicate what you've done on the weekend, I might ask you more more tips.

PS This isn't about drawing railway lines per se -  it's about gaining control of our minds !!  -
and dcad's mind as well !!  lol
and trying to get them to march in step !!!!
cheers

PS but thanks for the info on max curvature of rails as well lol.
Actually the thing that I find quite handy is that technique I showed in reply #1.  That is a shape I call a "tophat" - and at work we get stainless steel bent to that shape quite often.  I used to sketch/draw that shape with a few lines in 2D,  vanishing to give fake perspective.  But with practice it is quicker to go to 3D, extrude the shape (with or without taper for perspective), rotate it about Y and X axes (45 and 35 deg resp), and back to 2D, and you've got yourself an isometric view, and/or isometric perspective :).   

Oblique is 30 deg about X followed by 35 about Y ( working from memory here, maybe it's the other way round).

But once drawn, you can do a screensnip, and paste a jpeg image in the next workshop drawing.   It still gets the message across, even if not to scale for every project. (2 cents)
I enclose what is really going on (when seen in 3D as against from front).

samdavo

#8
ok , here's another challenge
see if you can draw an Ames room, and make the perspective work.  (long shot surely)
http://en.wikipedia.org/wiki/Ames_room

Whilst I'm at it - see the word "FRONT" that I added to the last image.   What is the best way to draw 3D text at the correct orientation, in this case in the XY Plane, but often in XZ (if on the top),  etc.  Even inclined I guess ?

Personally I just do dimensions, and after a few trial-an-errors, I am usually able to get the correct orientation, (even if I slip back to 2D yemporarily to do it);  but there must be a better way. (?)

PS sometimes I do a dimension, explode it, set handles on the text, and paste the bludy thing, lol.   Bit like a kid cheating with a Rubik's Cube.  cheers.

minstrel

Quote from: samdavo on October 31, 2013, 01:55:19 PM
...What is the best way to draw 3D text at the correct orientation...?

Sam, let's see if we can keep you on track :o :

Just treat it [3D text] like any other 'geometry' and set 3 handles...then use the Move [M] to help you gravity snap however and where ever you please.  Just make sure 'draw as 2D text' is uncheck [text dialogue]

samdavo

#10
Minstrel,  Quite right as usual.   

But thinking laterally, and speaking as a dog-lover, I subscribe to the principle that there are many ways to skin a cat,  and I'm happy to investigate them all :)

I still find "exploded dimensions" quite handy.

And talking about that,  I notice that using "T", you must set three points to install 3D text,
a) the first two give the line of the bottom of the text
b) the third sets the plane
c) but also it seems to set the slope of the text (variable italic - style) 
Indeed it can be difficult to avoid the "italic slope" to the 3D text (imo or imle anyway).
(imle = in my limited experience).

Dimensions always set the text without italics (or with predicable italic if you prefer).

In any event, a handy trick is to know how to set the third point in x y or z directions.
I believe that with care I can get pretty close with :-

Shift + mouse = X dirn  (to set the third point)
Ctrl + mouse = Y dirn
Ctrl+Shift + mouse = Z dirn

I enclose examples, dimensions added to a set of XYZ axes.   Cheers, and thanks.

(And of course, as you probably infer, you can always set the third point exactly with "point relative" )

(Edit - heck I notice you can even set 4 points so that the text twists. (2 cents) )

samdavo

#11
Here's a different way to get parallel receding lines which I find can be used for
a) railway lines, and even
b) crosshatching using text "lllll" (albeit with some extra effort, and no need to recede in this case).
Basically you can write 3D text called "llllll" - I have written it on the top of the tile "receding" into distance -
and then stretch it into Z dirn, "vc"+"mp" + "X" extrude it (to get the height of the sleepers).
(2 cents)

Summary  (Railway sleeper jpeg).
To get perspective, you also get some distortion, especially for anything seen partly from the side (eg the left hand "tile").
If you look at the text on the lefthand "tile", you will see that I encourage extra perspective (without extra distortion), i.e. the top of the text cuts across the top of the tile, resulting in twice the perspective for the text compared to the tile.    And this text is stretched into the z direction (making the width of the "l" letters wider.  All pretty obvious I hope.

PS There are problems with "exaggerated perspective" achieved this way - in that two parallel tracks will not have the same vanishing point. (unless you manipulate that with a rotation about the Y axis I guess  - see final jpeg, showing two sets of sleeps , the uptrack and the downtrack.     

Hey, do the USA drive their trains on the left or right track :)

samdavo

#12
ok, whilst I doubt that anyone except a geometry-nerd like me gives a shinbone, lol,  no sooner having found a problem, I find there is an answer.

The problem was that a duplicated/copied downtrack (on the right) drawn with exaggerated perspective has a different vanishing point (see the first jpag).

The answer is to mirror it instead - (see the purple "ballast") - again pretty obvious.

Where's this railway heading?  Hopefully better or rather stronger perspective without the distortion.  :)
cheers 

PS by deleting the first few sleepers ( closest to the camera), the distortion is reduced, even if you then zoom in.  (see dark blue sleepers).  I include the purple sleeper dcd to permit anyone interested to
a) delete a few close sleepers,
b) zoom in, and
c) get the same maximum perspective with lesser distortion.
i.e. I am claiming that the dark blue version, including exaggerated perspective,  is worth considering (2 cents)
(even if the height of the sleepers is not receding as quickly as their length)

samdavo

#13
btw, that cross hatching that started as 3D text "lllll" - here is an intermediate step. (nothing to do with perspective, but a byproduct of this bit of research / geometric chewing gum).

And another thing, they don't call I-beams I-beams for nothing :)
(same extruded text as per the superman example)
the jpeg shows two different fonts.

Or channels, or angles or RHS sections for that matter. - or twisted etc.

samdavo

#14
Quote from: adriank on October 31, 2013, 08:38:45 AM
Here you go Sam.
...
my station point is 1.5m above the track & I'm standing about 5m to one side. (didn't want to get run over by a train!)
So adrian, I should mention I have never successfully set a user-defined view from first principles (i.e. numerically) :)
and nothing seems to have changed today lol.

I set the left front corner of the first sleeper as origin.
Drew a crankhandle, X=-4m, Y=1.5, Z=-5  (to match where I thought you set your viewpoint) - I added a pointmark for fun.
Drawing that line is just for interest.

And went to view\user defined view  (edit - ok, there's a small error in that I use Z= +5, but trivial); 
with "angels" (sic) set as H=-9, V=20, twist = 0,  DIST 5.6,  (all of which was what you had, or so I thought) ...

And the result is pathetic lol.
More research req'd. (apologies for this hopeless result).

(The first jpeg shows standard isometric view, the second shows the result of view "sam1")


when I check, you had your eye at X0 = 49.5,  Y0 = 3.0, Z0 = -1.6;
but then again, your origin is such that the left corner of the first sleeper is at
X1 = 53.3,  Y0 = 1.5, Z0 = -1.6;
where this was the origin for me;
meaning that, for the same eye position relative to that sleeper, I should be using
X = 49.5 - 53.3 = -4.0, 
Y = 3.0 - 1.5 = +1.5,
Z = -1.6-(-1.6) = 0;

ok - a minor difference/error emerges, in that I used Z = 5, (or sometimes Z=-5), where I should strictly have used Z=0;    but (since the rail recedes in the positive z direction), surely that just means I see a few less or more of the close sleepers ?   As you say adrian, it's more about how far to the left (X=-4) and how high (Y=1.5).

PS Weird, but second time I opened that file, it seemed to behave ok (??)   and the difference between Z= +5 and Z = -5 is a major reduction in distortion for the first few sleepers ( see final jpeg, where the top view is from Z=5 and is distorted;

and the second is from Z=-5 and is ok.
There is a red sleeper as the fourth in the row in each case).