POV-Ray : Newsgroups : povray.binaries.animations : Playing with matrix transforms Server Time
5 Feb 2025 14:59:18 EST (-0500)
  Playing with matrix transforms (Message 13 to 22 of 22)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: William F Pokorny
Subject: Re: Playing with matrix transforms
Date: 26 Jan 2025 10:28:52
Message: <679654b4$1@news.povray.org>
On 1/25/25 19:22, Tor Olav Kristensen wrote:
> For those of you that want to be able to do matrix calculations within POV-Ray,
> I have made a library that can do some of that.
> 
> It can be found here:
> 
> https://github.com/t-o-k/POV-Ray-matrices

Thank you for the reminder. I'd looked at what you have there before - 
but my memory failed me in moment.

While I was "thinking aloud" about what was happening with the checker 
rotation/shear 'stick poking' play, your package would have saved me a 
chunk of time.

I've added a link to your page from my yuqk matrix documentation text 
file - which I hope will help me remember.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Playing with matrix transforms
Date: 26 Jan 2025 14:25:00
Message: <web.67968baa28e999341f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
(Rune's old 'illusion.inc' file is a
> prime example; I use it a lot, but its workings are a mystery to me.)

I have never used it, and the instructions puzzle me.
Perhaps if you could post a scene using it, and the intermediate render, then
maybe I can have some idea how to use it and see how it works.

Also, this seems like the sort of perspective correction that Francois LE COAT
would know all about.

- BW


Post a reply to this message

From: William F Pokorny
Subject: Re: Playing with matrix transforms
Date: 27 Jan 2025 08:40:57
Message: <67978ce9@news.povray.org>
On 1/25/25 19:58, William F Pokorny wrote:
> Next time I create an animation with ffmpeg, I'll try to get the 4:2:0 
> chroma sub-sampling.

Alright. Found myself playing again today with a direct matrix transform 
  against yuqk's updated wrinkle pattern. The attached animation uses 
the sampling you suggested. Does it work in programs where failing before?

Bill P.

             matrix <
                 1.0, (frame_number-1)/60, 0.0,
                -(frame_number-1)/60, 1.0, 0.0,
                 0.0, 0.0, 1.0,
                 (frame_number-1)/57, (frame_number-1)/37, 0.0>


Post a reply to this message


Attachments:
Download 'wrinkles.mp4.dat' (922 KB)

From: Kenneth
Subject: Re: Playing with matrix transforms
Date: 27 Jan 2025 10:50:00
Message: <web.6797aad828e99934e83955656e066e29@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 1/25/25 19:58, William F Pokorny wrote:
>
> > Next time I create an animation with ffmpeg, I'll try to get the 4:2:0
> > chroma sub-sampling.
>
> Alright. Found myself playing again today with a direct matrix transform
>  against yuqk's updated wrinkle pattern. The attached animation uses
> the sampling you suggested. Does it work in programs where failing before?
>

YES, this animation plays in all of my Windows media players, including
Irfanview. AND, it also plays in Firefox's 'preview'. Great work! Thanks for
taking the time to dig down into your settings for ffmpeg; very much
appreciated.

For this animation, my VLC Media Player does not report the particular 'chroma
subsampling' scheme that you used... but that seems to be its usual behavior
when encountering the 'typical' 4:2:0. So I guess the switch from 4:4:4 to 4:2:0
has solved the problem. That is interesting news! :-)


Post a reply to this message

From: William F Pokorny
Subject: Re: Playing with matrix transforms
Date: 31 Jan 2025 07:57:31
Message: <679cc8bb@news.povray.org>
On 1/19/25 15:33, William F Pokorny wrote:
> Playing more with matrix transforms

Recently the idea of splines as interpolations was touched upon in the 
thread:

https://news.povray.org/povray.advanced-users/thread/%3Cweb.6797e39ce9acc1774cc51b5c25979125%40news.povray.org%3E/

Perhaps obvious the matrix play in this thread can act as a rotational 
interpolation.

Attached an animation and full scene file for the animation (for jr). It 
should run in v3.8 beta 2 too.

Bill P.


Post a reply to this message


Attachments:
Download 'interpolatematrix.mp4.dat' (391 KB) Download 'interpolatematrix.pov.txt' (4 KB)

From: Bald Eagle
Subject: Re: Playing with matrix transforms
Date: 31 Jan 2025 09:25:00
Message: <web.679cdc7028e9993425b4de9225979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> Perhaps obvious the matrix play in this thread can act as a rotational
> interpolation.

Well now that we're going there - Bezier and other splines can all be
represented as matrix multiplications.

https://blog.demofox.org/2016/03/05/matrix-form-of-bezier-curves/

https://observablehq.com/@danburzo/the-matrix-form-of-some-common-cubic-splines

I know that clipka was talking about trying to find as much common ground for
all of the primitives as possible, so that we could have as few specialized
objects/data structures as possible, so perhaps it would good to look at a lot
of the spline/interpolation code as matrix-based.

We ought to have robust and versatile matrix methods available anyway.

Also, rotational matrices tie directly into complex numbers - so maybe there's a
way to roll that in there too.

- Bald "I want it all" Eagle


Post a reply to this message

From: ingo
Subject: Re: Playing with matrix transforms
Date: 31 Jan 2025 10:10:00
Message: <web.679ce6fd28e9993417bac71e8ffb8ce3@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> I know that clipka was talking about trying to find as much common ground for
> all of the primitives as possible, so that we could have as few specialized
> objects/data structures as possible, so perhaps it would good to look at a lot
> of the spline/interpolation code as matrix-based.

There are a few fun things one can do with the matrix based spline calculations.
One can blend two spline matrices to a new spline, or over time morph from one
spline to an other spline type. But one needs access to POV-Ray's internals
then.

The whole spline matrices thing is covered here:

http://web.archive.org/web/20151002232205/http://home.comcast.net/~k9dci/site/?/page/Piecewise_Polynomial_Interpolation
/

Download the book PDF and the separate appendix.

ingo


Post a reply to this message

From: Kenneth
Subject: Re: Playing with matrix transforms
Date: 3 Feb 2025 12:25:00
Message: <web.67a0fafa28e99934e83955656e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> > Rune's old 'illusion.inc' file is a prime example [of a complex matrix];
> > I use it a lot, but its workings are a mystery to me.
>
> I have never used it, and the instructions puzzle me.
> Perhaps if you could post a scene using it, and the intermediate render, then
> maybe I can have some idea how to use it and see how it works.
>

(Sorry for the delay, I was updating my own notes about illusion.inc and running
more test renders.)

Yeah, it was confusing to me as well when I first tried to use it-- mainly
because it is set up as a demonstration file rather than a basic include. And
the demonstration results are a bit confusing, IMO. It is basically a different
way of applying an image_map to objects-- but from the camera's viewpoint, and
with a rather magical matrix manipulation that alters the 'depth perspective' of
the applied image.

It is still available at
https://runevision.com/3d/include/

(Rune mentions that the download has a 2010 update by Sam Benge, which is
apparently no longer part of it; I checked recently.)

Back in 2013, I posted some preliminary info about how the include file works:
https://news.povray.org/povray.binaries.images/thread/%3Cweb.5106f53bd9b7ab13c2d977c20%40news.povray.org%3E/

I also posted a kind of explanatory animation at the time, but it is in
an older .avi video format:
https://news.povray.org/povray.binaries.animations/thread/%3Cweb.5106fb628df1613ec2d977c20%40news.povray.org%3E/?ttop=4
44658&toff=150

I should mention have been using my own simplified and slightly updated version
of the include file for years. I've had thoughts of posting it-- along with my
own set of instructions and a different demo-- but was worried that it might
infringe on Rune's original copyright notice from 2003. Although, I now see that
an update would probably be OK to post.

Rune's matrix transform is quite mysterious (to me) because it uses the
*camera's* settings, along with some math manipulations that are presently way
over my head.


Post a reply to this message

From: Kenneth
Subject: Re: Playing with matrix transforms
Date: 3 Feb 2025 16:45:00
Message: <web.67a138af28e99934e83955656e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> {Illusion.inc] is basically a different
> way of applying an image_map to objects-- but from the camera's viewpoint, and
> with a rather magical matrix manipulation that alters the 'depth perspective'
> of the applied image.
>

It essentially applies the image_map as an 'orthographic' projection onto scene
objects, devoid of perspective... which is quite different from a typical
map_type 0 projection.


Post a reply to this message

From: Bald Eagle
Subject: Re: Playing with matrix transforms
Date: 3 Feb 2025 17:10:00
Message: <web.67a13e6b28e999341f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> It is basically a different
> way of applying an image_map to objects-- but from the camera's viewpoint, and
> with a rather magical matrix manipulation that alters the 'depth perspective' of
> the applied image.

Yes, I get that part.


> Rune's matrix transform is quite mysterious (to me) because it uses the
> *camera's* settings, along with some math manipulations that are presently way
> over my head.

So, as best I can tell, he's simply done the kind of thing that's done in the
"make this object/text always face the camera"... with the matrix.

but the image_map is converted to a function that incorporates x/z and y/z which
also corrects for the projection matrix so that everything lines up no matter
how near or far.

I just haven;t had the time to figure out how to start applying his include to a
scene, so that I can reverse-engineer it enough to provide a didactic diagram
and explanation.

So if you have working code....   ;)

- BW


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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