POV-Ray : Newsgroups : povray.general : Not grokking mesh camera Server Time
23 Apr 2024 17:53:04 EDT (-0400)
  Not grokking mesh camera (Message 8 to 17 of 17)  
<<< Previous 7 Messages Goto Initial 10 Messages
From: Josh English
Subject: Re: Not grokking mesh camera
Date: 5 May 2023 02:17:07
Message: <64549f63@news.povray.org>
On 5/2/2023 4:24 AM, jr wrote:
> hi,
> 
> Josh English <Jos### [at] joshuarenglishcom> wrote:
>> ...
>>>> code to "try things" would have been nice/helpful.
>>> True. Unfortunately my code is so hodge-podge I am always reluctant ...
> 
> know that feeling :-)  also think though that when one runs into a problem,
> writing some code just to replicate the problem in the simplest scene possible,
> can often provide (new) insight.
> 
> 
>>> I've attached the code that's misbehaving.
>>    Oh ffs.
> 
> </grin>
> 
> thanks.  will follow this thread with interest, as mesh cam is a big puzzle to
> me.
> 
> regards, jr.
> 

I found the mistake that is causing the skewed image. I forgot the end 
condition on a FOR loop will can the end value of the loop, so I was 
calculating one extra pixel per row, which the mesh camera dutifully 
pushed to the next row, so my original code was generating more 
triangles than needed.

Live and learn.

Well ... live.

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Not grokking mesh camera
Date: 5 May 2023 06:25:00
Message: <web.6454d95f69f793731f9dae3025979125@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:

> I found the mistake that is causing the skewed image. I forgot the end
> condition on a FOR loop will can the end value of the loop, so I was
> calculating one extra pixel per row, which the mesh camera dutifully
> pushed to the next row, so my original code was generating more
> triangles than needed.

Ah - that explains it.

Of course, now that you've discovered that, you could actually (ab)use that to
do things like a TV-interference effect.  Also wondering what happens if you
double the columns and halve the rows.  Triple, quadruple...


Perhaps at some point when you get everything mostly worked out to your liking,
you can post a working scene file.  It would be nice to make some explanatory
diagrams to complement the extant documentation, and maybe make a version that
makes use of a Bezier patch as the camera control surface.  :)

Nice job hunting down the cause.

- BW


Post a reply to this message

From: Josh English
Subject: Re: Not grokking mesh camera
Date: 5 May 2023 16:30:02
Message: <6455674a$1@news.povray.org>
On 5/5/2023 3:24 AM, Bald Eagle wrote:
> It would be nice to make some explanatory
> diagrams to complement the extant documentation, and maybe make a version that
> makes use of a Bezier patch as the camera control surface.

I'm thinking about how to explain some of my discoveries to expand on 
Jaime's work.

But bezier patches? That's a cruel challenge. I don't know how to 
convert a patch to a mesh in the first place. That's why I used them: to 
let POV-Ray do the hard work.

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Not grokking mesh camera
Date: 5 May 2023 18:50:00
Message: <web.6455876669f793731f9dae3025979125@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:
> But bezier patches? That's a cruel challenge.

Not even remotely.

> I don't know how to
> convert a patch to a mesh in the first place. That's why I used them: to
> let POV-Ray do the hard work.

Mr. English, my dear Sir, TOK and I have done all of the hard work, and you may
generate a mesh of triangles from any Bezier patch that you wish.

You're not even subject to the u and v step limits for rendering the patch,
since you'll be custom generating the mesh in SDL.

Here ya go:


Post a reply to this message


Attachments:
Download 'beziertrianglemesh.pov.txt' (11 KB)

From: jr
Subject: Re: Not grokking mesh camera
Date: 6 May 2023 06:25:00
Message: <web.64562a9869f7937358c093306cde94f1@news.povray.org>
hi,

Josh English <Jos### [at] joshuarenglishcom> wrote:
> ...
> I found the mistake that is causing the skewed image. ...

thank you (very much).  this has set me on yet-another-unexpected-detour :-)


> Live and learn.
> Well ... live.

+1


regards, jr.


Post a reply to this message

From: jr
Subject: Re: Not grokking mesh camera
Date: 7 May 2023 08:15:00
Message: <web.645795fb69f7937358c093306cde94f1@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> ...
> this has set me on yet-another-unexpected-detour :-)

first WIP, with the 'z' components of the triangle corners "jiggled", a little.


regards, jr.


Post a reply to this message


Attachments:
Download 'mc_wip.png' (296 KB)

Preview of image 'mc_wip.png'
mc_wip.png


 

From: Bald Eagle
Subject: Re: Not grokking mesh camera
Date: 7 May 2023 11:30:00
Message: <web.6457c38169f793731f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > ...
> > this has set me on yet-another-unexpected-detour :-)
>
> first WIP, with the 'z' components of the triangle corners "jiggled", a little.
>
>
> regards, jr.

That's pretty cool.

I like the "blurred" effect that it gives.  I wonder if there's any way to fill
in some the graininess in the first pass, or maybe a custom convolution kernel
could be used for a second pass to "correct" the rgb 0 pixels that --- I guess
missed hitting anything in the scene.

What if you jiggle not every pixel randomly, but every row as a whole?

I can imagine that one could apply sine waves and other curves to the mesh and
get a sort of fun-house mirror effect ... maybe.

As I understand it, you can layer / sum mesh cameras?  Some interesting
experiments to be done there, I'm sure.

- BE


Post a reply to this message

From: Josh English
Subject: Re: Not grokking mesh camera
Date: 8 May 2023 01:52:21
Message: <64588e15$1@news.povray.org>
On 5/7/2023 8:28 AM, Bald Eagle wrote:

> 
> As I understand it, you can layer / sum mesh cameras?  Some interesting
> experiments to be done there, I'm sure.
> 
> - BE
> 

Exactly. I just posted an image of my desert towers with a cheesy effect 
that took 4 hours to render, which is for me a long time.

The mesh_camera can fire many rays for each pixel, one ray per defined 
mesh, and add them together.

And since you probably have a defined mesh, you can include it in the 
scene file itself with a texture and it will effect every pixel. It's 
kind of like screen.inc magic but with any projection type, even the 
whacked out things mesh_cameras can do.

I'm still trying to solve a few problems and then I have to figure out 
how to post my tutorial on what I've learned.

Josh


Post a reply to this message

From: jr
Subject: Re: Not grokking mesh camera
Date: 8 May 2023 08:55:00
Message: <web.6458f0b969f7937358c093306cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> What if you jiggle not every pixel randomly, but every row as a whole?
> I can imagine that one could apply sine waves and other curves to the mesh and
> get a sort of fun-house mirror effect ... maybe.

yes.  as written, that is starting with stuff copied + modified from the
distribution mesh_cam scene/inc, there isn't really a good way of picking a
subset (of triangles) to treat separately.  (will put together an email, later
or tomorrow)


> As I understand it, you can layer / sum mesh cameras?  Some interesting
> experiments to be done there, I'm sure.

yes, and agree, interesting stuff ahead.


regards, jr.


Post a reply to this message

From: Josh English
Subject: Re: Not grokking mesh camera
Date: 8 May 2023 11:29:44
Message: <64591568$1@news.povray.org>
On 5/8/2023 5:53 AM, jr wrote:
> hi,
> 
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>> ...

> yes.  as written, that is starting with stuff copied + modified from the
> distribution mesh_cam scene/inc, there isn't really a good way of picking a
> subset (of triangles) to treat separately.  (will put together an email, later
> or tomorrow)
> 
> 

Actually, I've been playing with that, too, but the image is not so 
great because I'm a crappy modeller. This technique is based of Jaime's 
macros. I've been directly calculation the location of each spline out 
of stubbornness. Jaime relies on the trace function, which means you can 
filter the triangles with an object. I think his method using trace is 
superior to mine. I had to reinvent some wheels to get to a point of 
understanding, though.

In the attached image the sky and clouds and "grass" are all fairly 
normal (the "grass" is a plane at y=0), but the attempt at a starry 
water scene is actually sitting at y=-20.

Cheers.


Post a reply to this message


Attachments:
Download 'portal_test.png' (153 KB)

Preview of image 'portal_test.png'
portal_test.png


 

<<< Previous 7 Messages Goto Initial 10 Messages

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