POV-Ray : Newsgroups : povray.newusers : Help out a newbie to understand the coord system Server Time
25 Nov 2024 11:36:02 EST (-0500)
  Help out a newbie to understand the coord system (Message 1 to 8 of 8)  
From: Fi3l2
Subject: Help out a newbie to understand the coord system
Date: 19 Nov 2005 13:15:00
Message: <web.437f6b34442657b89d6a7880@news.povray.org>
I have taken higher level maths here college and all of them use a different
coordinate system than povray. From what I understand, povray uses a x-z 2d
plane with a y 3d dimension plane. I am used to a x-y 2d and z 3d.

This really shouldn't matter, should it? I can just place my camera looking
at a certain way and i can describe all of my objects in any coordinates I
would like.
If this is the case, then my code below would simply produce a sphere but
for some odd reason, it doesnt.. it just produces a black screen. Anyone
help? Or is the only option to use the correct coord system?
Let me know

#include "colors.inc"
background{ color LightBlue }
camera{
        location <10,0,10>
        look_at <0,5,0>
        }
light_source{
        <-5,-5,13>
        color White
        }
plane{
        z,0
        color Yellow
      }
sphere{
        <0,5,2.5>,2.5
        color Orange
      }


Post a reply to this message

From: Mike Williams
Subject: Re: Help out a newbie to understand the coord system
Date: 19 Nov 2005 13:51:01
Message: <RQjnrBAOQ3fDFw8E@econym.demon.co.uk>
Wasn't it Fi3l2 who wrote:
>I have taken higher level maths here college and all of them use a different
>coordinate system than povray. From what I understand, povray uses a x-z 2d
>plane with a y 3d dimension plane. I am used to a x-y 2d and z 3d.
>
>This really shouldn't matter, should it? I can just place my camera looking
>at a certain way and i can describe all of my objects in any coordinates I
>would like.
>If this is the case, then my code below would simply produce a sphere but
>for some odd reason, it doesnt.. it just produces a black screen. Anyone
>help? Or is the only option to use the correct coord system?
>Let me know
>
>#include "colors.inc"
>background{ color LightBlue }
>camera{
>        location <10,0,10>
>        look_at <0,5,0>
>        }
>light_source{
>        <-5,-5,13>
>        color White
>        }
>plane{
>        z,0
>        color Yellow
>      }
>sphere{
>        <0,5,2.5>,2.5
>        color Orange
>      }
>

You have to say "pigment {colour Yellow}" and "pigment {colour Orange}".

"colour" outside a pigment is obsolete syntax. It doesn't do anything,
so the pigment of the object remains at the default black, and you don't
see the pure black sphere in front of the pure black plane.

It used to be for low quality previews. You could set up a complicated
pattern in the pigment, and then use a plain colour for the previews.
These days computers run quite a bit faster than they did when that
syntax is introduced, and the pigment is always used, whatever the
quality setting. They just haven't got round to removing the acceptance
of the obsolete syntax from the parser.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Slime
Subject: Re: Help out a newbie to understand the coord system
Date: 19 Nov 2005 14:42:13
Message: <437f8015@news.povray.org>
> From what I understand, povray uses a x-z 2d
> plane with a y 3d dimension plane. I am used to a x-y 2d and z 3d.
>
> This really shouldn't matter, should it? I can just place my camera
looking
> at a certain way and i can describe all of my objects in any coordinates I
> would like.


It matters only in one place, where POV-Ray calculates the camera
orientation from your location and look_at vectors. It uses the cross
product between vectors to get perpendicular vectors, but it assumes that
the result points a specific way from the vectors operated on; if you're
using a right handed coordinate system instead of a left handed one, this
assumption will be incorrect. The result is that the image will look
mirrored from what you would expect in a right-handed system. You can avoid
this by specifying the direction, up, and right vectors manually, but you'll
have to calculate them yourself.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Fi3l2
Subject: Re: Help out a newbie to understand the coord system
Date: 19 Nov 2005 15:05:01
Message: <web.437f8491f330323389d6a7880@news.povray.org>
Nevermind, I just was messing with it and i included the texture and pigment
parts of the code and it works just fine.
Anyways, Thank You

"Fi3l2" <fly### [at] yahoocom> wrote:
> I have taken higher level maths here college and all of them use a different
> coordinate system than povray. From what I understand, povray uses a x-z 2d
> plane with a y 3d dimension plane. I am used to a x-y 2d and z 3d.
>
> This really shouldn't matter, should it? I can just place my camera looking
> at a certain way and i can describe all of my objects in any coordinates I
> would like.
> If this is the case, then my code below would simply produce a sphere but
> for some odd reason, it doesnt.. it just produces a black screen. Anyone
> help? Or is the only option to use the correct coord system?
> Let me know
>
> #include "colors.inc"
> background{ color LightBlue }
> camera{
>         location <10,0,10>
>         look_at <0,5,0>
>         }
> light_source{
>         <-5,-5,13>
>         color White
>         }
> plane{
>         z,0
>         color Yellow
>       }
> sphere{
>         <0,5,2.5>,2.5
>         color Orange
>       }


Post a reply to this message

From: Fi3l2
Subject: Re: Help out a newbie to understand the coord system
Date: 19 Nov 2005 15:30:00
Message: <web.437f8a7af330323389d6a7880@news.povray.org>
Thank you for your response. I would prefer to use a right handed coord
system, but I have no idea how to specify my own vectors to do this in
povray.

If my camera orientation is the only thing that matters, would it be
possible to somehow rotate the camera so it views the coord system
correctly? After fixing the minor problem of the pigment part in my code, i
notice that bascially the oreintation of the camera is upside down. I am
currently just trying to rotate the camera to view the scene properly.

I realize that in the future, just rotating the camera will not help me in
the calculating of different objects because of the left-handedness of the
system, but for now, I dont think im worried about that.



on a side note, in this system the unit vectors x,y,z are basically defines
as <1,0,0>,<0,1,0>,<0,0,1> respectively. Couldn't I just reassign the
vectors to what they would be in a right handed system? such as z =
<0,0,-1>  ?
I will try nonetheless.

Thanks again
Paul

"Slime" <fak### [at] emailaddress> wrote:
> > From what I understand, povray uses a x-z 2d
> > plane with a y 3d dimension plane. I am used to a x-y 2d and z 3d.
> >
> > This really shouldn't matter, should it? I can just place my camera
> looking
> > at a certain way and i can describe all of my objects in any coordinates I
> > would like.
>
>
> It matters only in one place, where POV-Ray calculates the camera
> orientation from your location and look_at vectors. It uses the cross
> product between vectors to get perpendicular vectors, but it assumes that
> the result points a specific way from the vectors operated on; if you're
> using a right handed coordinate system instead of a left handed one, this
> assumption will be incorrect. The result is that the image will look
> mirrored from what you would expect in a right-handed system. You can avoid
> this by specifying the direction, up, and right vectors manually, but you'll
> have to calculate them yourself.
>
>  - Slime
>  [ http://www.slimeland.com/ ]


Post a reply to this message

From: Warp
Subject: Re: Help out a newbie to understand the coord system
Date: 19 Nov 2005 16:10:47
Message: <437f94d6@news.povray.org>
Fi3l2 <fly### [at] yahoocom> wrote:
> Thank you for your response. I would prefer to use a right handed coord
> system, but I have no idea how to specify my own vectors to do this in
> povray.

http://tag.povray.org/povQandT/morayQandT.html#handedness

-- 
                                                          - Warp


Post a reply to this message

From: Larry Hudson
Subject: Re: Help out a newbie to understand the coord system
Date: 19 Nov 2005 20:46:48
Message: <437fd588$1@news.povray.org>
Fi3l2 wrote:
> Thank you for your response. I would prefer to use a right handed coord
> system, but I have no idea how to specify my own vectors to do this in
> povray.

Even though it's not what you would prefer, I would strongly urge you to 
reconsider and try to learn to think in terms of the left-handed default 
coords of POV-Ray.  After all, this is the default that all other Povers 
use.  And continuing to try to force POV-Ray into RH-coords will make it 
difficult for you to follow other's code or for them to read yours -- as 
well as being inconvenient to code.

> ...
> 
> I realize that in the future, just rotating the camera will not help me in
> the calculating of different objects because of the left-handedness of the
> system, but for now, I dont think im worried about that.

Yes, you should worry about it.  If you don't make the effort now I 
expect it will be much harder for you later.  Sure, it'll be a 
brain-twisting-wrench, but in the long term it's bound to be advantageous.

Just a suggestion, of course, but please consider it.

      -=- Larry -=-


Post a reply to this message

From: Frango com Nata
Subject: Re: Help out a newbie to understand the coord system
Date: 26 Nov 2005 13:30:00
Message: <web.4388a92df3303233c181fd400@news.povray.org>
Have you noticed that the reference system's handedness is not an inherent
quality of it, but which depends solely on the viewer, i.e. the camera? The
most an observer can do is compare two given non-coplanar vector-triplet
and tell whether they are oriented the same or the opposite way. So the
following camera statement is likely to meet your expectation:

camera{
  location /*where?*/
  right 4/3*x
  up z
  direction 3*y
  sky z
  look_at /*where?*/
  //angle /*how much?*/ // Leaving out this line, you'll get a realistic
perspective for a full-screen image at a normal working distance from the
monitor
}


Post a reply to this message

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