POV-Ray : Newsgroups : povray.binaries.scene-files : New version screen.inc Server Time
5 May 2024 17:53:43 EDT (-0400)
  New version screen.inc (Message 22 to 31 of 52)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: cbpypov
Subject: Re: New version screen.inc
Date: 3 Nov 2017 18:40:01
Message: <web.59fcef3fb4b00596591d362a0@news.povray.org>
This is a really cool feature which I'd like to use for an animation. Somehow it
does not work for me: the camera "zooms in" much more than using the normal
orthographic camera. The object positioning of text does not work either, as
shown in the standard screen.inc example attached.

What am I doing wrong. Or did something change?


Post a reply to this message


Attachments:
Download 'screentest.png' (105 KB)

Preview of image 'screentest.png'
screentest.png


 

From: Stephen
Subject: Re: New version screen.inc
Date: 3 Nov 2017 21:57:17
Message: <59fd1e7d@news.povray.org>
On 03/11/2017 22:35, cbpypov wrote:
> This is a really cool feature which I'd like to use for an animation. Somehow it
> does not work for me: the camera "zooms in" much more than using the normal
> orthographic camera. The object positioning of text does not work either, as
> shown in the standard screen.inc example attached.
> 
> What am I doing wrong. Or did something change?
> 

You are right. You can only use screen.inc with the perspective camera.


Fake it. Move the camera further away and reduce the angle.


-- 

Regards
     Stephen


Post a reply to this message

From: cbpypov
Subject: Re: New version screen.inc
Date: 4 Nov 2017 15:20:00
Message: <web.59fe12d3b4b00596663654620@news.povray.org>
>
> You are right. You can only use screen.inc with the perspective camera.
>
>
> Fake it. Move the camera further away and reduce the angle.
>
>
> --
>
> Regards
>      Stephen


Wasn't it just the objective of SharkD's file to actually make screen.inc
compatible with the orthographic camera? I.e. the issue of this thread?? A few
posts before some people state that it behaves as expected, but I can't seem to
get it to work.

It would be nice to have this feature, because I already have all the camera
positions of my animations and simply wanted to add a subtitle and some displays
in front of the camera. Due to the scientific background of the animation I'd
really prefer to have the orthographic cam.

Stephen, I tried your suggestion (without thinking, though) and just multiplied
the camera location vector by 10, and divided the angle by 10. It did not work
:) Is there a known mathematical way to fake the ortho-cam with my working
camera settings (i.e. a simple transformation that I can apply in the end)?

Thank you!


Post a reply to this message

From: Stephen
Subject: Re: New version screen.inc
Date: 4 Nov 2017 15:56:44
Message: <59fe1b7c@news.povray.org>
On 04/11/2017 19:19, cbpypov wrote:
>>
>> You are right. You can only use screen.inc with the perspective camera.
>>
>>
>> Fake it. Move the camera further away and reduce the angle.
>>
>>
>> --
>>
>> Regards
>>       Stephen
> 
> 
> Wasn't it just the objective of SharkD's file to actually make screen.inc
> compatible with the orthographic camera? I.e. the issue of this thread?? A few
> posts before some people state that it behaves as expected, but I can't seem to
> get it to work.
> 

Oops! I forgot the beginnings of this thread.
That's what he said in the first post. But the third one with an 
attachment still says:

> // You can only use screen.inc with the perspective camera. Screen.inc
> // will automatically create the camera definition for you when it is
> // included.




> It would be nice to have this feature, because I already have all the camera
> positions of my animations and simply wanted to add a subtitle and some displays
> in front of the camera. Due to the scientific background of the animation I'd
> really prefer to have the orthographic cam.
> 
> Stephen, I tried your suggestion (without thinking, though) and just multiplied
> the camera location vector by 10, and divided the angle by 10. It did not work
> :) Is there a known mathematical way to fake the ortho-cam with my working
> camera settings (i.e. a simple transformation that I can apply in the end)?
> 

There will be a tangent in there some way.

https://en.wikipedia.org/wiki/Angle_of_view#Derivation_of_the_angle-of-view_formula

All those hard quantum sums, eh? ;-)




> Thank you!
> 


-- 

Regards
     Stephen


Post a reply to this message

From: cbpypov
Subject: Re: New version screen.inc
Date: 4 Nov 2017 17:50:00
Message: <web.59fe354ab4b00596663654620@news.povray.org>
Stephen <mca### [at] aolcom> wrote:

>
> Oops! I forgot the beginnings of this thread.
> That's what he said in the first post. But the third one with an
> attachment still says:
>
> > // You can only use screen.inc with the perspective camera. Screen.inc
> > // will automatically create the camera definition for you when it is
> > // included.
>

No need to remember it: it's there, online, you can read it again ;) But I think
you copied these lines from its screen.inc attachment. BUT, these lines are
there because SharkD copied them from the original screen.inc and frogot to
delete them :D Maybe it's me: but I am sure this thread would not be here if
SharkD did not have tried to get ortho-cam to work. Moreover, his
reimplementation of Set_Camera would not have a new `orth` parameter:

    #macro Set_Camera(Location, LookAt, Angle, Ortho)

Right?

So, ... we are a bit at cross-purposes, i think. I attached examples of a
minimal scene. minimal_perspective.pov uses the normal camera, and using
screen.inc (minimal_screen.pov) gives identical results. When setting the
ortho-cam in the traditional way, I get the expected result (minimal_ortho.pov).
However, when using SharkD's screen.inc and setting `ortho=on`), the result is
way different (minimal_ortho_screen.pov). I think this is not how it is supposed
to work, i.e. minimal_ortho.png and minimal_ortho_screen.png are supposed to be
identical, but they are not.

>
> There will be a tangent in there some way.
>
> https://en.wikipedia.org/wiki/Angle_of_view#Derivation_of_the_angle-of-view_formula
>
> All those hard quantum sums, eh? ;-)
>

I see, it should be simple ;) I tried it, see minimal_ortho_fake.pov. But it is
still wrong :/

Does anyone see a fix for SharkD's approach? Or do you see where my mistake in
the fake version is?

Thanks :)


Post a reply to this message


Attachments:
Download 'minipov.zip' (176 KB)

From: Stephen
Subject: Re: New version screen.inc
Date: 5 Nov 2017 04:10:00
Message: <web.59fed53cb4b005965035c1510@news.povray.org>
Reposting this so I can pick it up in thunderbird.

(It came through the first time blank.)


"cbpypov" <nomail@nomail> wrote:
> Stephen <mca### [at] aolcom> wrote:
>
> >
> > Oops! I forgot the beginnings of this thread.
> > That's what he said in the first post. But the third one with an
> > attachment still says:
> >
> > > // You can only use screen.inc with the perspective camera. Screen.inc
> > > // will automatically create the camera definition for you when it is
> > > // included.
> >
>
> No need to remember it: it's there, online, you can read it again ;) But I think
> you copied these lines from its screen.inc attachment. BUT, these lines are
> there because SharkD copied them from the original screen.inc and frogot to
> delete them :D Maybe it's me: but I am sure this thread would not be here if
> SharkD did not have tried to get ortho-cam to work. Moreover, his
> reimplementation of Set_Camera would not have a new `orth` parameter:
>
>     #macro Set_Camera(Location, LookAt, Angle, Ortho)
>
> Right?
>
> So, ... we are a bit at cross-purposes, i think. I attached examples of a
> minimal scene. minimal_perspective.pov uses the normal camera, and using
> screen.inc (minimal_screen.pov) gives identical results. When setting the
> ortho-cam in the traditional way, I get the expected result (minimal_ortho.pov).
> However, when using SharkD's screen.inc and setting `ortho=on`), the result is
> way different (minimal_ortho_screen.pov). I think this is not how it is supposed
> to work, i.e. minimal_ortho.png and minimal_ortho_screen.png are supposed to be
> identical, but they are not.
>
> >
> > There will be a tangent in there some way.
> >
> >
https://en.wikipedia.org/wiki/Angle_of_view#Derivation_of_the_angle-of-view_formula
> >
> > All those hard quantum sums, eh? ;-)
> >
>
> I see, it should be simple ;) I tried it, see minimal_ortho_fake.pov. But it is
> still wrong :/
>
> Does anyone see a fix for SharkD's approach? Or do you see where my mistake in
> the fake version is?
>
> Thanks :)


Post a reply to this message

From: Stephen
Subject: Re: New version screen.inc
Date: 5 Nov 2017 08:32:33
Message: <59ff12f1@news.povray.org>
On 05/11/2017 09:09, Stephen wrote:
> Reposting this so I can pick it up in thunderbird.
> 
> (It came through the first time blank.)
> 
> 
> "cbpypov" <nomail@nomail> wrote:
>> Stephen <mca### [at] aolcom> wrote:
>>
>>>
>>> Oops! I forgot the beginnings of this thread.
>>> That's what he said in the first post. But the third one with an
>>> attachment still says:
>>>
>>>> // You can only use screen.inc with the perspective camera. Screen.inc
>>>> // will automatically create the camera definition for you when it is
>>>> // included.
>>>
>>
>> No need to remember it: it's there, online, you can read it again ;) But I think
>> you copied these lines from its screen.inc attachment. BUT, these lines are
>> there because SharkD copied them from the original screen.inc and frogot to
>> delete them :D Maybe it's me: but I am sure this thread would not be here if
>> SharkD did not have tried to get ortho-cam to work. Moreover, his
>> reimplementation of Set_Camera would not have a new `orth` parameter:
>>
>>      #macro Set_Camera(Location, LookAt, Angle, Ortho)
>>
>> Right?
>>

Hands up for posting without validating. :-(


>> So, ... we are a bit at cross-purposes, i think. I attached examples of a
>> minimal scene. minimal_perspective.pov uses the normal camera, and using
>> screen.inc (minimal_screen.pov) gives identical results. When setting the
>> ortho-cam in the traditional way, I get the expected result (minimal_ortho.pov).
>> However, when using SharkD's screen.inc and setting `ortho=on`), the result is
>> way different (minimal_ortho_screen.pov). I think this is not how it is supposed
>> to work, i.e. minimal_ortho.png and minimal_ortho_screen.png are supposed to be
>> identical, but they are not.
>>

You are right. I imported a couple of the scenes into Bishop3D, to get a 
visual representation of the cameras.
Adjusting the Up and Right Vectors of the orthogonal camera until the 
"look at" areas coincided. The angle I read back was 66.67. Substituting 
that into  minimal_ortho_screen.pov it was out by a factor of 2. an 
angle of 66.67/2 gave me a very similar image to minimal_perspective.pov


I conclude that there is something not right with the way that 
screen_ortho.inc converts angle into the the other vectors.

Finding what is beyond me.I would be still at it when the cows came home.



>>>
>>> There will be a tangent in there some way.
>>>
>>>
https://en.wikipedia.org/wiki/Angle_of_view#Derivation_of_the_angle-of-view_formula
>>>
>>> All those hard quantum sums, eh? ;-)
>>>
>>
>> I see, it should be simple ;) I tried it, see minimal_ortho_fake.pov. But it is
>> still wrong :/
>>

I had a quick look at it and it is beyond me. I'm afraid.



-- 

Regards
     Stephen


Post a reply to this message

From: cbpypov
Subject: Re: New version screen.inc
Date: 5 Nov 2017 13:10:01
Message: <web.59ff536db4b005968248f19d0@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
>
> Hands up for posting without validating. :-(
>

Sorry, I cannot really follow what you mean ... did I do something wrong? :(

>
> You are right. I imported a couple of the scenes into Bishop3D, to get a
> visual representation of the cameras.
> Adjusting the Up and Right Vectors of the orthogonal camera until the
> "look at" areas coincided. The angle I read back was 66.67. Substituting
> that into  minimal_ortho_screen.pov it was out by a factor of 2. an
> angle of 66.67/2 gave me a very similar image to minimal_perspective.pov
>
>
> I conclude that there is something not right with the way that
> screen_ortho.inc converts angle into the the other vectors.
>
> Finding what is beyond me.I would be still at it when the cows came home.
>

Glad we're talking about the same things now :) Cool that you can do such things
with Bishop3D! I may have a look at what it is capable of.

However, maybe it was not really beyond you. I just had a look at SharkD's code,
and (again without actually thinking very much) I just found two little bugs.
There was just a factor of 2 missing here and there :D It now works in gives
exactly the results without the screen.inc. Hope you like it :)

JUST A SHORT question beyond that... using the screen.inc camera setting method
it seems that I cannot rotate the camera anymore, but need to use the sky-vector
instead. How do I do this? :)

Thanks for your help.
Best,
Carlo


Post a reply to this message


Attachments:
Download 'screen_ortho.inc.txt' (8 KB)

From: cbpypov
Subject: Re: New version screen.inc
Date: 5 Nov 2017 14:30:00
Message: <web.59ff65d8b4b005968248f19d0@news.povray.org>
"cbpypov" <nomail@nomail> wrote:
>
> JUST A SHORT question beyond that... using the screen.inc camera setting method
> it seems that I cannot rotate the camera anymore, but need to use the sky-vector
> instead. How do I do this? :)

Found it myself :) I have to use vaxis_rotate on the camera location instead of
the sky vector. In my case I have to rotate around the y axis by the desired
degrees.

So it seems that everything is working now for me...


Post a reply to this message

From: Kenneth
Subject: Re: New version screen.inc
Date: 5 Nov 2017 14:35:01
Message: <web.59ff66e1b4b0059689df8d30@news.povray.org>
from SharkD originally...
> > Update:

> > ...Also includes a new macro called
> > "Get_Screen_XY" to return the 2D screen location of a set of 3D coordinates.

Captain Jack replied in 2009...
> Cool... I hadn't read through the Get_Screen_XY macro yet, but I did write a
> scene to test it, which I've attached. The macro worked exactly as expected,
> with no errors. The animation itself is of a group of three balls connected
> by springs that float around the screen. I had the program create a text
> file giving the screen coordinates for the center of one of the spheres in a
> format that can be read by Particle Illusion. I Rendered the scene in POV,
> then I imported the text file into PI, then composited the whole thing over
> a background picture, and everything lined up exactly right with no error
> message generated at any point.

That Particle Illusion animation looks VERY good (I haven't gotten around to
trying  out that particular Rune(?) code yet, though.) It makes me wonder if
SharkD's original Get_Screen_XY macro (or any of its subsequent updates or
fixes) can successfully track an object with the camera actually moving around--
or maybe with just pan and tilt. (The animation example is with a fixed camera;
and SharkD didn't specifically mention camera motion.)  I haven't yet tried out
the macro or looked at his various code updates-- which apparently still have
some problems, it seems-- but *if* it could, it would make a really nice
camera-tracking package. Well, at least for tracking an animated moving-camera
POV-Ray rendered scene.


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.