POV-Ray : Newsgroups : povray.newusers : Smooth swinging camera work Server Time
24 Apr 2024 09:50:19 EDT (-0400)
  Smooth swinging camera work (Message 11 to 20 of 32)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bald Eagle
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 09:30:00
Message: <web.570a5509e1dfd56f80403a200@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
> On 4/10/2016 1:37 PM, Bald Eagle wrote:

> Just one thing to mention. There are two coordinate systems*, Y up and Z
> up.

Right.  I've use right-handed, z-up, and it did, for whatever strange human
reason, take a bit of getting used to when I started using POV's left-handed
y-up system.

But some days (nights) _nothing_ makes sense, and that's why drawing things out,
and checking both the math and _the assumptions_ you are progressing from, are
always a good idea.
I use lots of paper, Excel spreadsheets, unit circle diagrams, 3D space models
or diagrams, test renders, etc.

> One of the reasons I use a modeller I cannot visualise scenes well
> enough to be a true Pover.

> * Not counting all the fancy ones like Polar, Plücker, cylindrical etc.

I wouldn't really call polar "fancy" - especially since I often find it easier
on the brain to "be lazy" and do the ole' define an object at the origin,
translate, then rotate.   Saves doing a lot of trig to get the coordinates,
especially if I'm not just rotating in one plane, but then tilting up into "3D".
   Cylindrical is just polar with an "altitude" (z) thrown in.

Plucker looks like something clipka might be well familiar with.   I have a
feeling he's got a way better handle on all of that affine geometric stuff than
I've got.

But yes, SecondCup - you should take Mr. McAvoy's advice and make sure that your
assumptions about your axes are correct.   That has caused me, and many other
POV-ers way too many unnecessary headaches.   I've even done it when I KNEW I
wanted to be avoiding it.   So write it down, calculate it, and graph it out.
Don't just let your code fly into uncharted territory - nail down your FACTS,
and double and triple check what you're doing until you get it to work out
correctly.   Then - just for fun, and as a test of how robust your code is,
change some things around a bit.   Add in things like negative values, zero,
very large values, etc. to see how robust your system is, and to make sure that
you're not just in some little coincidental mathematical bubble.



avoid opinion, care not what the neighbors think, never mind the unguessable



― Robert A. Heinlein


Post a reply to this message

From: clipka
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 10:38:13
Message: <570a6555$1@news.povray.org>
Am 10.04.2016 um 15:00 schrieb Stephen:
> On 4/10/2016 1:37 PM, Bald Eagle wrote:
>> The coordinate system is a static "thing"  It doesn't "do" anything.
>> Look_at just determines what direction the camera is pointing when
>> it's at a
>> given location ("vector").
> 
> Just one thing to mention. There are two coordinate systems*, Y up and Z
> up. Depends if you are a mathematician or an engineer. Moray used Z up.
> There is also left hand and right hand versions too.
> One of the reasons I use a modeller I cannot visualise scenes well
> enough to be a true Pover.
> 
> * Not counting all the fancy ones like Polar, Plücker, cylindrical etc.

In other words, you refer to cartesian coordinates only.

Well, actually there are only _two_ fundamentally different
3-dimensional cartesian coordinate systems: A right-handed one and a
left-handed, and _infinitely_ many different orientations of those two
coordinate systems, each of which are equally valid from a mathematical
point of view.

So accomodating only for the handedness and a choice of whether Y or Z
is up doesn't quite cut it.


Post a reply to this message

From: Alan Holding
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 10:55:01
Message: <web.570a68f9e1dfd56f1ebcfeef0@news.povray.org>
"SecondCup" <nomail@nomail> wrote:
> Can anyone point me to a good link to help me out? Or is there a sure-fire way
> to connect the two camera shots?

Some of Chris Colefax's POV-Ray Include Files (archived GeoCities pages are
here: http://www.oocities.org/ccolefax/) may be of use and / or save your brain
melting as he's done a lot of the hard work on this kind of stuff already.

The Spline Macro File (archived at
http://www.oocities.org/ccolefax/spline/index.html, with a tutorial) lets you
generate and preview splines and also, most useful to you I think, sample
positions along a spline based on a clock value. So, if the POV-Ray animation
clock is 0.5 you can find out the position of a point half way along the spline.

Combine that with the Automatic Clock Modifier Macro, which is part of the Clock
Modifier Include File (archived at
http://www.oocities.org/ccolefax/clockmod.html - the downloadable zip file
contains very good documentation on both) and you can have more control, e.g.
sample the point along the spline based on a manipulated clock value.

Mr Colefax's code is over a decade old, but still works a treat. I've done this
kind of stuff with it in the past:
http://news.povray.org/povray.binaries.animations/thread/%3C3a6f29ef%40news.povray.org%3E/


Post a reply to this message

From: clipka
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 10:56:37
Message: <570a69a5$1@news.povray.org>
Am 10.04.2016 um 15:28 schrieb Bald Eagle:

> Plucker looks like something clipka might be well familiar with.   I have a
> feeling he's got a way better handle on all of that affine geometric stuff than
> I've got.

Uh... actually, no. Besides the fact that the proper ASCII rendition
would be "Pluecker", I think the only thing I truly know about that
coordinate system is that I have not the faintest idea what it even does :)

(Well, from the Wikipedia page I do grasp that it uses /some/ set of six
values to identify straight lines, rather than using a set of three
values to identify points. But that's about as far as I get without
having to cool my brain with liquid nitrogen.)


Post a reply to this message

From: clipka
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 10:59:55
Message: <570a6a6b$1@news.povray.org>
Am 10.04.2016 um 16:37 schrieb clipka:
> So accomodating only for the handedness and a choice of whether Y or Z
> is up doesn't quite cut it.

Uh... never mind this portion of my post. Somehow my brain was still
tuned to a different topic.

I really should try that liquid nitrogen.


Post a reply to this message

From: SecondCup
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 12:40:01
Message: <web.570a80c3e1dfd56f95dcb8070@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "SecondCup" <nomail@nomail> wrote:
>
> > Nice! The lower image looks good until my code wants it to rotate around the
> > center 360 degrees.
>
> "Until the code I wrote that I think will rotate it around..."
> Don't anthropomorphize POV-Ray, SDL, or your computer.
> Only YOU _want_ something to happen.  Then you follow the rules of the puzzle to
> get the OS to run POV-Ray which interprets the SDL and then makes a Cartesian
> grid of colored pixels.
>
> > Because I tell the code to 'look_at <the center>', the coordinate system isn't
> > doing what I want.
>
> The coordinate system is a static "thing"  It doesn't "do" anything.
> Look_at just determines what direction the camera is pointing when it's at a
> given location ("vector").
>
>
> > Without being locked to viewing the center, the coordinates would be:
> > 6oclock location <0,-15,-65>
> > 3oclock location <65,-15,0>
> > 12oclock location <0,-15,+65>
> > 9oclock location <-65,-15,0>
> >
> > This would create the points on a spleen to rotate around the centre, but my
> > camera wouldnt be focused on the center. The look_at command causes the z-value
> > to act like a zoom-in/out tool.
>
> Those would be the coordinates regardless of where the camera is looking, or if
> there is even a camera at all.   The clock still exists even if a blind man or
> no one at all is looking at it.  (Let's not get into quantum delayed-choice
> gedanken experiments....)
>
> If those are your cardinal points on the clock, go back, draw it out on a piece
> of paper (or preferably on a unit-circle diagram) and then double-check any
> intermediate points you have in your spline.
> An easy way to do this without paper or a spreadsheet or trig, is to just do
> what I just did with the camera path(s) and place some yellow spheres at the
> points where you want the camera to pass through, and see if it lines up with
> where your spline gets interpolated to be.
>
> I would start out with something VERY simple, like your top-down view of a
> clock, with the first 4 points, and then start progressively adding points -
> then you can see where things start to go wrong.
>
> I'm on the road all day today - I'll look at this again some time after I get
> back in, sleep, go to work, get back, etc.  ;)
>
> Good luck   :)


That worked! I quickly tried my coordinates there and it worked. Thanks mate. I
have some stuff to do today myself but once I get my code fully functioning ill
post it here.

Thank you for the advice. It's much appreciated!


Post a reply to this message

From: SecondCup
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 16:30:01
Message: <web.570ab6e6e1dfd56f95dcb8070@news.povray.org>
Thanks to everyone for the advice and suggestions. I got it to do exactly what I
wanted. Happy days. Here's my code...note that I drop the camera vertically,
then transition into a smooth arc to rotate 360 degrees around my center point
followed lastly by a smooth arc into a zoom. All while focused just below the
center.

Once you get the hang of the coordinate system, building a spline is the way to
go for smooth animations.

#declare CameraSpline =
    spline {
        natural_spline

        0.0, <0,10,-65>
        0.1, <0,0,-65>
        0.2, <10, -10, -65>
        0.3, <65, -15, 0>
        0.4, <0, -15, +65>
        0.5, <-65, -15, 0>
        0.7, <-10, -15, -65>
        0.8, <0, -15, -45>
        1.0, <0, -5, -25>
       }

  camera{
    location < CameraSpline(clock).x, CameraSpline(clock).y,
CameraSpline(clock).z >
    rotate < 0, 0, 0>
    look_at < 0 , -10 , 0>
        }


Post a reply to this message

From: Bald Eagle
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 19:00:01
Message: <web.570adadae1dfd56f5e7df57c0@news.povray.org>
"SecondCup" <nomail@nomail> wrote:
> Thanks to everyone for the advice and suggestions. I got it to do exactly what I
> wanted. Happy days.

Congrats!  :)  I'm happy it's all working out for you.
Sometimes you just need enough of a nudge over some "threshhold", and then it
all clicks into place after that.

> Once you get the hang of the coordinate system, building a spline is the way to
> go for smooth animations.

There are indeed many uses for splines, and there are all sorts of neat little
tricks and things that people have come up with.   Heck, there's SO much stuff
in just the documentation that most of the time it's hard to even know what to
do with it all!

Be sure to check out http://www.f-lohmueller.de/  as well.   He's put a LOT of
work into posting very useful working code and tutorials.


Post a reply to this message

From: Stephen
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 19:09:15
Message: <570add1b@news.povray.org>
On 4/10/2016 3:37 PM, clipka wrote:
> Am 10.04.2016 um 15:00 schrieb Stephen:
>> On 4/10/2016 1:37 PM, Bald Eagle wrote:
>>> The coordinate system is a static "thing"  It doesn't "do" anything.
>>> Look_at just determines what direction the camera is pointing when
>>> it's at a
>>> given location ("vector").
>>
>> Just one thing to mention. There are two coordinate systems*, Y up and Z
>> up. Depends if you are a mathematician or an engineer. Moray used Z up.
>> There is also left hand and right hand versions too.
>> One of the reasons I use a modeller I cannot visualise scenes well
>> enough to be a true Pover.
>>
>> * Not counting all the fancy ones like Polar, Plücker, cylindrical etc.
>
> In other words, you refer to cartesian coordinates only.
>
> Well, actually there are only _two_ fundamentally different
> 3-dimensional cartesian coordinate systems: A right-handed one and a
> left-handed, and _infinitely_ many different orientations of those two
> coordinate systems, each of which are equally valid from a mathematical
> point of view.
>
> So accomodating only for the handedness and a choice of whether Y or Z
> is up doesn't quite cut it.
>

Well it confused me going from Moray's Y up to PovRay's Z up coordinate 
system. It is easy to make a mistake. It was also the source of many a 
flame war, years ago.
A 2D X-Y plane is looked down on like a piece of paper by mathematicians 
and Z is up/height. Whilst Engineers looked into an oscilloscope and Z 
is depth. Or the other way around. Lutz of Moray fame wouldn't hear talk 
about it.
It is a simple transformation to convert and I know for a fact Thomas 
has memorised it.

So what doesn't cut what?
I don't understand.

-- 

Regards
     Stephen


Post a reply to this message

From: Stephen
Subject: Re: Smooth swinging camera work
Date: 10 Apr 2016 19:11:24
Message: <570add9c@news.povray.org>
On 4/10/2016 3:59 PM, clipka wrote:
> Am 10.04.2016 um 16:37 schrieb clipka:
>> So accomodating only for the handedness and a choice of whether Y or Z
>> is up doesn't quite cut it.
>
> Uh... never mind this portion of my post. Somehow my brain was still
> tuned to a different topic.
>
> I really should try that liquid nitrogen.
>

Too late, too late. Was the reply. :)

And you are extracting what, using liquid nitrogen?

-- 

Regards
     Stephen


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.