POV-Ray : Newsgroups : povray.binaries.animations : Which ship would you rather ride in? Server Time
19 Jul 2024 15:29:01 EDT (-0400)
  Which ship would you rather ride in? (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Rune
Subject: Re: Which ship would you rather ride in?
Date: 7 Jan 2003 18:36:07
Message: <3e1b6467@news.povray.org>
Greg M. Johnson wrote:
> I said once you'd completed the turn--
> I'd assert you always want zero roll.

And it is very easy to calculate the transformation that gives zero
roll.

> Interesting Q:  Is there a way to compute
> instantaneous "sphere of curvature" on a
> plain ol' pov 35. spline?

I don't know. Anyway, you may have use of looking at the file in the
POV-Ray distribution

scenes/animations/splinefollow/splinefollow.pov

And maybe have a look at the Spline_Trans macro in transforms.inc - not
that it will perfectly fit your needs, but it can perhaps get you
started.

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com (updated Oct 19)
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Which ship would you rather ride in?
Date: 7 Jan 2003 21:41:03
Message: <Xns92FD25F245CE9torolavk@204.213.191.226>
"Greg M. Johnson" <gregj:-)565### [at] aolcom> wrote in
news:3e1ad518$1@news.povray.org: 

> You're purely correct for a turn.  You're right about needing to
> roll your own macro.
> 
> But when you're beyond a region with any considerable "curvature to
> the path"-- I said once you'd completed the turn--  I'd assert you
> always want zero roll.
> 
> Interesting Q:  Is there a way to compute instantaneous "sphere of
> curvature" on a plain ol' pov 35. spline?
...

I don't know what you really mean by "sphere of
curvature". But I guess that you are want to find
the radius of the curve at a specific point along
a spline.

You can solve that problem numerically by
finding two other points, on the spline, close
to the point that you would like to find the
curvature for.

You could for example find these points by
choosing one T-value a little below the T-value
for the point in question, and one T-value a
little above. 

When you have these 3 points, and if they are
not co-linear, then there is only one cirlce
in 3D-space that will "pass through" them all.
And this circle is possible find analytically.

In this post you'll win find a macro I made
that does that job:

http://news.povray.org/povray.general/17701/114420
A reply I made to Mark M. Wilson's thread
"general geometry question" 21. Aug. 2001 to
povray.general.

This post may also be relevant. (Same thread)
http://news.povray.org/povray.general/17701/114421/


// Define problem
#declare t0 = 1.56;
#declare p0 = YourSpline(t0);
#declare H = 1e-5;
#declare p1 = YourSpline(t0 + H);
#declare p2 = YourSpline(t0 - H);

// Call macro to solve problem
#declare pCtr = <0, 0, 0>;
#declare Rad = 0;
#declare vN = <0, 0, 0>;
CircleTouches3Points(p0, p1, p2, pCtr, Rad, vN)


After the macro call, Rad will contain the
radius of the circle that "goes through"
these 3 points. pCtr and vN will also contain
info that may be useful.

Note that if the points are co-linear then:

vlength(vcross(p1 - p0, p2 - 0)) = 0

I.e. the radius will be infinite, and the
macro will fail if called with these points
as inputs. (So you better test for this first.)

Here is an image that shows how these circles
would be for different points along a spline:
http://news.povray.org/povray.binaries.images/12141/


This is just my "first thoughts" about this
problem. There are most likely other more
correct and/or simpler methods available.


Tor Olav


P.S. If you meant to find the sphere that
"fits best" beneath your curve at the 
point YourSpline(t0), then here's a
suggestion for some code that I think will
work:

// Define problem
#declare t0 = 1.56;
#declare H = 1e-5;
#declare pA = YourSpline(t0 - H*2);
#declare pB = YourSpline(t0 - H);
#declare pC = YourSpline(t0 + H);
#declare pD = YourSpline(t0 + H*2);

// Call macro to solve problem
#declare pCtr = <0, 0, 0>;
#declare Rad = 0;
SphereTouches4Points(pA, pB, pC, pD, pCtr, Rad)
// This macro can be found in mentioned post.


Remember to check for co-planarity before
calling this macro. I.e. check if:

vdot(pB - pA, vcross(pC - pA, pD - pA)) = 0


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Which ship would you rather ride in?
Date: 8 Jan 2003 09:05:53
Message: <3e1c3041@news.povray.org>
"Rune" <run### [at] runevisioncom> wrote in message
news:3e1b6467@news.povray.org...
> Greg M. Johnson wrote:
> > I said once you'd completed the turn--
> > I'd assert you always want zero roll.
>
> And it is very easy to calculate the transformation that gives zero
> roll.
>

I found one that looks great in all situations , except for an abrupt filp
when you cross the z=0 plane while pointing downward.  I'm pleased with it
but wonder if there's a more elegant, one-step solution out there that even
avoids this problem.  Care to share yours?


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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