![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Tim Nikias v2 0
Subject: Re: Creating tunnels... (MPGs, 2x126 kb)
Date: 11 Feb 2004 11:27:04
Message: <402a57d8@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> I'm not sure I understand. Why do you need any sky-vector in the first
> place? Why do you need to know anything about the spin of the tunnel?
You somehow have to put the two forward- and up-vectors into relation. I
thought that maybe projecting both forward vectors onto a plane, get the
angle, rotate the vectors and then calculate new angles for the up-vector
might be a way to go. You've probably got something faster up your sleeve,
the way you phrase it...
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Here's some crude and simple code to explain the basic idea. The
> algorithm is simpler than I remembered. Just use the VPerp_Adjust()
> macro to make the last up-vector perpendicular to the current
> forward-vector and then use that as the current up-vector... The code
> here just aligns boxes and does not create a tunnel out of a mesh, but
> the basic idea is the same.
Hm. I can see that it works, but I don't understand why and how. I can't
visualize what that VPerp_Adjust actually does, and why it works for
generating a proper new matrix for the new box. Care to elaborate and
enlighten me? :-)
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tim Nikias v2.0 wrote:
>> Here's some crude and simple code to explain the basic idea. The
>> algorithm is simpler than I remembered. Just use the VPerp_Adjust()
>> macro to make the last up-vector perpendicular to the current
>> forward-vector and then use that as the current up-vector... The code
>> here just aligns boxes and does not create a tunnel out of a mesh,
>> but the basic idea is the same.
>
> Hm. I can see that it works, but I don't understand why and how. I
> can't visualize what that VPerp_Adjust actually does
From the doc:
VPerp_Adjust(V1, Axis). Find a vector perpendicular to Axis and in the
plane of V1 and Axis. In other words, the new vector is a version of V1
adjusted to be perpendicular to Axis.
So the new Y vector is the same as the previous Y vector, except that it
is adjusted to be perpendicular with the new Z vector. Since the
previous and the new Y vectors are as close to each other as possible,
there is no twisting.
The Y and Z vectors are now perpendicular, and from those we can get the
X vector using the vcross-function. Now we have the local X, Y and Z
vector for the box as well as its origin P, and then we can create its
transformation matrix out of those four vectors.
That's all really.
Rune
--
3D images and anims, include files, tutorials and more:
rune|vision: http://runevision.com **updated Jan 29**
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Tim Nikias v2 0
Subject: Re: Creating tunnels... (MPGs, 2x126 kb)
Date: 11 Feb 2004 20:40:10
Message: <402ad97a@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> That's all really.
Hm, now that you've described it, I can actually build a visual
representation in my mind. You see, as long as I can't actually tell via
diagramm (even if its a complicated one that only fits into the mind, not on
paper) I don't really grasp the formula. I've read the doc, but I got
confused somewhere with that Last_Y and the actual Y etc. Now I can picture
it and understand it.
Now that I've understood it, I'll try to implement it, shouldn't be too much
of a problem. Once the tunnel is properly constructed, I'll get to the
actual tricky part: water simulation. I'm still wondering if I should make
something half-artistic and half-simulation, so that I can actually control
the effects, but still have some degree of realism... Ah well, I'll come to
that later. Maybe I'll ponder about it for a few days and tackle some other
stuff first.
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tim Nikias v2.0 wrote:
> Hm, now that you've described it, I can actually
> build a visual representation in my mind. You see, as
> long as I can't actually tell via diagramm (even if
> its a complicated one that only fits into the mind,
> not on paper) I don't really grasp the formula.
My mind works the same way... :)
> Once the tunnel is properly constructed, I'll get to
> the actual tricky part: water simulation.
I'm looking forward to see what you'll come up with!
Rune
--
3D images and anims, include files, tutorials and more:
rune|vision: http://runevision.com **updated Jan 29**
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |