POV-Ray : Newsgroups : povray.advanced-users : Truck and trailer Server Time
29 Jul 2024 12:27:18 EDT (-0400)
  Truck and trailer (Message 11 to 20 of 35)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Pandora
Subject: Re: Truck and trailer
Date: 27 Aug 2002 12:10:31
Message: <3d6ba477@news.povray.org>
"Thomas" <tho### [at] gmxnet> wrote in message
news:web.3d6b9ebba31ba4aabbe30ae0@news.povray.org...
> Christoph Hormann wrote:
>
> >BTW, you can also think of it a different way: The two wheels and their
> >axis always move on a circle with it's center somewhere on the axis.
>
> That's what someone here at work suggested as well, but the truck is
moving
> along a spline and I don't think that it is easy to determine the radius
of
> the spline at any given point.
>


    Then the best way to do it would be the small-step physical simulation
kind of approach that Christoph suggested - you'll need to work out the
direction and magnitude of the movement at the link between the car/truck
and trailer and remember that the car/truck and trailer are fixed distances
from that point, oh, also the trailer will pivot around it's center of
gravity (which you can probably safely assume is at the intersection of two
diagonals of the bounding rectangle of the plan view of the main body of the
trailer (unless it's a really oddly shaped trailer))...

--
Pandora/Scott Hill/[::O:M:C::]Scorpion
Software Engineer.
http://www.pandora-software.com


Post a reply to this message

From: Thomas van der Veen
Subject: Re: Truck and trailer
Date: 27 Aug 2002 12:47:47
Message: <Xns9277B4FF9C2E4veentukibmcom@204.213.191.226>
"Pandora" <pan### [at] pandora-softwarecom> wrote in
> also the trailer will pivot
> around it's center of gravity (which you can probably safely assume is
> at the intersection of two diagonals of the bounding rectangle of the
> plan view of the main body of the trailer (unless it's a really oddly
> shaped trailer))... 


hmmm I thought it would turn on it's axle. Otherwise the wheels would still 
move sideways.


Thomas


Post a reply to this message

From: Pandora
Subject: Re: Truck and trailer
Date: 27 Aug 2002 16:38:26
Message: <3d6be342@news.povray.org>
"Thomas van der Veen" <tho### [at] gmxnet> wrote in message
news:Xns### [at] 204213191226...
> "Pandora" <pan### [at] pandora-softwarecom> wrote in
> > also the trailer will pivot
> > around it's center of gravity (which you can probably safely assume is
> > at the intersection of two diagonals of the bounding rectangle of the
> > plan view of the main body of the trailer (unless it's a really oddly
> > shaped trailer))...
>
>
> hmmm I thought it would turn on it's axle. Otherwise the wheels would
still
> move sideways.
>


    hmm... you could be right... no, center of gravity... no axel... no
c.o.g... no, axel... but what about trailers with 4 wheels.... no c.o.g...
no... Ah, damn it, when I wrote that I was certain I was right, now I just
don't know.... I think it's round the center of gravity, and the wheels do
move sideways - think about the case where you've got a trailer with 4 (or
more) wheels, but I'm not certain anymore...

--
Pandora/Scott Hill/[::O:M:C::]Scorpion
Software Engineer.
http://www.pandora-software.com


Post a reply to this message

From: Mark Wagner
Subject: Re: Truck and trailer
Date: 28 Aug 2002 02:43:34
Message: <pan.2002.08.28.06.42.50.637076.211@gte.net>
On Tue, 27 Aug 2002 16:40:17 -0400, Pandora quoth:

> "Thomas van der Veen" <tho### [at] gmxnet> wrote in message
> news:Xns### [at] 204213191226...
>> "Pandora" <pan### [at] pandora-softwarecom> wrote in
>> > also the trailer will pivot
>> > around it's center of gravity (which you can probably safely assume
>> > is at the intersection of two diagonals of the bounding rectangle of
>> > the plan view of the main body of the trailer (unless it's a really
>> > oddly shaped trailer))...
>>
>>
>> hmmm I thought it would turn on it's axle. Otherwise the wheels would
>> still
>> move sideways.
>>
> ... but what about trailers with 4 wheels

In general, the trailer will pivot around the point halfway between the
front axle and the back axle.  Also in general, the path of the pivot
point of the trailer will inside the path of the trailer hitch.

-- 
Mark


Post a reply to this message

From: Tim Attwood
Subject: Re: Truck and trailer
Date: 28 Aug 2002 04:37:53
Message: <3D6C8BE9.D2B71743@worldnet.att.net>
First off a 4 wheel trailer has a second pivot point, think of a childs wagon
and it will become obvious.  Secondly the hitch and axle are the only places
free to pivot normally, center of gravity shouldn't matter unless there is a
crash.
If you are turning a simple curve with the tractor, the trailer axle should
follow
a curve with a radius bigger than the tractors turning radius by the distance
from the hitch to the trailers axle. So if the tractor turns with radius R1, and
D is
the distance from hitch to trailer axle, the axle should travel a curve with
radius
R2 = R1 + D

--
Tim Attwood


Post a reply to this message

From: J  Diehl
Subject: Re: Truck and trailer
Date: 29 Aug 2002 08:15:04
Message: <web.3d6e0f83a31ba4aaf70c33440@news.povray.org>
If you are looking for a physically realistic solution, you started at the
wrong way at all - a Truck will never follow a spline. The rear axis never
follows the front (steering) wheels. Think of a long vehicle turning sharp
around a corner - while the front will pass it, the back will cut the edge!
All I want to say is that you can't expect a physically right simulation of
your trailer with any mathematic model, while your truck doesn't follow
physics at all!
But even if you can fix this - for a full phyisical simulaton you will need
a more detailed mathematical and physical description of truck and trailer.
The center of gravity will play a role as much as the mass of the trailer,
the speed of all components and even the friction of the ground. Think of
movements with high speed, on ice or in empty space!

But lets do a simpler model - at first for the simplest trailer-system: a
two-wheeled trailer pulled by hand.
Build a pole - a triangle, where (A) is the left wheel, (B) the right and
(C) the coupling in your hand. So (AB) is the axis and (M) shall be the
middle of the axis (AB). Then lets pull the coupling (C) to any new
position (P) in the easiest way we coul describe and without hurting
physics:
1. turn the trailer around (M) towards (P) so that the trailer is 'looking'
at (P) (the axis (AB) is orthogonal to the direction (MP))
2. move the trailer straight along (MP) until (C) is at (P)

To follow a given path in a smooth manner, we have to do many steps - turn,
move, turn, move, turn, move... - until we are there. Note that this
movement will look different than doing the same at one step and
interpolating the position!!!

In my thoughts and on paper this seems to result in a nearly realistic
movement - i had no time to try it in a simulation yet.

Once we have a solution for this two-wheeled trailer, a pulling system
(truck and trailer) and even a four-wheeled trailer will be simple: put
some poles together, where every coupling is at the center of the previous
axis.
Every four-wheeled trailer will need a pole (otherwise it can't be pulled
around corners!), so you can simply connect two two-wheeled trailers to get
a four-wheeled.
The truck itself will be a two-pole-system, too, where the first coupling is
a thought one: the point where the driver is aiming at. This point will be
the one following your spline step by step.

What do you think about this model?


Post a reply to this message

From: J  Diehl
Subject: Re: Truck and trailer
Date: 29 Aug 2002 17:15:06
Message: <web.3d6e8dc9a31ba4aac82a5e2b0@news.povray.org>
Yeah, that's it! I just wrote a simulation in Visual Basic (code see below).
Didn't think it would really work so naturally! It feels really great, you
can even drive backwards with a trailer! And it's easy to add as many
trailers as you want. :-)))

I made some drawings to illustrate the description above. Since I can't post
attachments here, you will have to download it as PDF from my server (need
the Acrobat Reader from adobe.com - it's free)

http://enter.diehlsworld.de/raytracing/truck.pdf

BTW, Thomas, you were on the right way with your first posting: the angle
and the whole behavior just depends on the length of the trailer.

Perhaps this weekend, I will try a POV-implementation that will be posted
here when working... (it will need more trigonometry than the VB-script
below)

And here the VB-code:
----------------------------
Rem Truck-Trailer-Problem
Rem Visual Basic Script
Rem (c) 2002 by J. Diehl
Rem http://enter.diehlsworld.de

Rem make a form with a picture object called 'picture1' and paste this code
into the codeview
Rem start the program and move the mouse over the picture

Rem Data for the trailers 1-3
Rem cx,cy the pole where the trailer will be pulled
Rem ax,ay the middle of the axis (and the coupling for the next trailer)
Dim cx1, cy1, ax1, ay1
Dim cx2, cy2, ax2, ay2
Dim cx3, cy3, ax3, ay3


Rem do a drive-step for any trailer
Rem where myax,myay,mycx,mycy are the specific trailer data to be modified
in this step
Rem newx,newy: the target for the pole in this step
Rem length: the length of the pole
Public Sub drive(ByRef myax, ByRef myay, ByRef mycx, ByRef mycy, newx, newy,
length)

Rem get the vector axis - new position
dx = newx - myax
dy = newy - myay

Rem set the trailer along this vector and move it to the new position
d = Sqr(dx * dx + dy * dy)
tomove = d - length
myax = myax + dx / d * tomove
myay = myay + dy / d * tomove

Rem draw the trailer
Picture1.Circle (myax, myay), 4, 0
Picture1.Circle (newx, newy), 2, 255
wx = (newx - myax) / length * 20
wy = (newy - myay) / length * 20
Picture1.Line (-wy + myax, wx + myay)-(wy + myax, -wx + myay), 255
Picture1.Line (-wy + myax, wx + myay)-(newx, newy), 255
Picture1.Line (wy + myax, -wx + myay)-(newx, newy), 255

End Sub

Private Sub Form_Load()
Rem set ScaleMode pixel for graphic output
Picture1.ScaleMode = 3
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)

Rem clear screen and get user mouse position
Picture1.Cls
px = X
py = Y

Rem first trailer drives to px,py (user-position)
Rem next trailer drives to the middle of the axis of the previous trailer
and so on...
drive ax1, ay1, cx1, cy1, px, py, 50
drive ax2, ay2, cx2, cy2, ax1, ay1, 50
drive ax3, ay3, cx3, cy3, ax2, ay2, 130

End Sub

----------

That's all!
Have a nice time with it...
Jo


Post a reply to this message

From: Thomas van der Veen
Subject: Re: Truck and trailer
Date: 30 Aug 2002 08:42:15
Message: <Xns927A8B5D9BFB0veentukibmcom@204.213.191.226>
"J. Diehl" <j.d### [at] firemailde> wrote in
news:web.3d6e0f83a31ba4aaf70c33440@news.povray.org: 

> If you are looking for a physically realistic solution, you started at
> the wrong way at all - a Truck will never follow a spline. The rear
> axis never follows the front (steering) wheels. Think of a long
> vehicle turning sharp around a corner - while the front will pass it,
> the back will cut the edge! All I want to say is that you can't expect
> a physically right simulation of your trailer with any mathematic
> model, while your truck doesn't follow physics at all!
> But even if you can fix this - for a full phyisical simulaton you will
> need a more detailed mathematical and physical description of truck
> and trailer. The center of gravity will play a role as much as the
> mass of the trailer, the speed of all components and even the friction
> of the ground. Think of movements with high speed, on ice or in empty
> space! 

I don't think I said that I was looking for a completly correct physical 
model. The things I want to model are not physical correct anyway (the 
trucks can't steer for instance)

> But lets do a simpler model - at first for the simplest
> trailer-system: a two-wheeled trailer pulled by hand.
> Build a pole - a triangle, where (A) is the left wheel, (B) the right
> and (C) the coupling in your hand. So (AB) is the axis and (M) shall
> be the middle of the axis (AB). Then lets pull the coupling (C) to any
> new position (P) in the easiest way we coul describe and without
> hurting physics:
> 1. turn the trailer around (M) towards (P) so that the trailer is
> 'looking' at (P) (the axis (AB) is orthogonal to the direction (MP))
> 2. move the trailer straight along (MP) until (C) is at (P)

I came up with something quite similar over the last few days, but slighty 
diferent due to the fact that my implementation is different ofcourse.
 
> What do you think about this model?


Looks promising!!! 

I had a look at your VB code but to be honest I don't quite understand it, 
but I will try and implement something this weekend and with a bit of luck 
I can show an animation somewhere in the near future. I also downloaded 
your PDF file. It looks great!

Thanks!!!!

Thomas


Post a reply to this message

From: J  Diehl
Subject: Re: Truck and trailer
Date: 31 Aug 2002 20:15:02
Message: <web.3d715afea31ba4aac8339f710@news.povray.org>
>I came up with something quite similar over the last few days, but slighty
>diferent due to the fact that my implementation is different ofcourse.

Quite similar - thats not surprising. I think it's the only way to catch the
problem.

>Looks promising!!!
>
>I had a look at your VB code but to be honest I don't quite understand it,
>but I will try and implement something this weekend and with a bit of luck
>I can show an animation somewhere in the near future. I also downloaded
>your PDF file. It looks great!

That was a nice topic for my homepage: I've just finished a site describing
my model with all math and trigonometry in more detail. Inclusive a
realtime flash-simulation and a POV animation with realistic steering front
wheels (commented POV source available).

So if you get stuck with your implementation (or anyone else being
interested in driving POV trucks) feel free to have a look at mine.
http://enter.diehlsworld.de

No alcohol when driving!
Cheers
jo


Post a reply to this message

From: Pandora
Subject: Re: Truck and trailer
Date: 31 Aug 2002 22:08:13
Message: <3d71768d@news.povray.org>
"J. Diehl" <j.d### [at] firemailde> wrote in message
news:web.3d715afea31ba4aac8339f710@news.povray.org...
> I've just finished a site describing
> my model with all math and trigonometry in more detail. Inclusive a
> realtime flash-simulation and a POV animation with realistic steering
front
> wheels (commented POV source available).
>


    Very nice! I had minutes of fun driving the flash-sim truck around - it
even exhibits the wishbone-ing (for the want of a better word) when
reversing problem - I now understand why my Dad insisted on deciding where
we'd set up the trailer tent on family holidays _first_ and then drove it
_forwards_ on to our chosen spot and would curse if we said "no, move it
back a little" ! (Actually we all understood why, at the time, but that
never stopped us wanting it moved back every year...)

--
Pandora/Scott Hill/[::O:M:C::]Scorpion
Software Engineer.
http://www.pandora-software.com


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.