POV-Ray : Newsgroups : povray.general : Global handedness setting? Server Time
31 Oct 2024 23:32:05 EDT (-0400)
  Global handedness setting? (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Mike Horvath
Subject: Global handedness setting?
Date: 22 Sep 2018 01:41:13
Message: <5ba5d5f9$1@news.povray.org>
Is there a way to change the handedness of a scene? I am doing a lot of 
astronomy calculations, and they are all right handed.

If not, could such a setting be added to POV-Ray? Thanks.



Mike


Post a reply to this message

From: Thomas de Groot
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 02:41:21
Message: <5ba5e411$1@news.povray.org>
On 22-9-2018 7:41, Mike Horvath wrote:
> Is there a way to change the handedness of a scene? I am doing a lot of 
> astronomy calculations, and they are all right handed.
> 
> If not, could such a setting be added to POV-Ray? Thanks.
> 

There are different types of 'handedness' depending on which way the 
different axis point. For Moray, which had z up and x right, the 
following transform was used:

transform {
   scale <1, 1, -1>
   rotate x*90
}

Could be used from POV->Moray or from Moray->POV.

You may have to experiment because in some cases/applications the x or 
the z axis can point the other way round. For instance, in Silo (which 
is left-handed) the z axis points out of the screen. The same kind of 
things may apply to right-handed applications I guess.

-- 
Thomas


Post a reply to this message

From: clipka
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 04:01:48
Message: <5ba5f6ec$1@news.povray.org>
Am 22.09.2018 um 07:41 schrieb Mike Horvath:
> Is there a way to change the handedness of a scene? I am doing a lot of
> astronomy calculations, and they are all right handed.

In POV-Ray, handedness is defined by the camera. The defaults

    right     x*1.33
    up        y
    direction z

or, in v3.8.0

    right     x*image_width/image_height
    up        y
    direction z

result in a left-handed coordinate system. For a right-handed coordinate
system, you have to set one (or all three) of these vectors to the
opposite direction, e.g.:

    direction -z


Note that this works even if you override the actual directions by using
`look_at`.


Note that this also has an effect on textures; you may need to mirror
planet image maps (e.g. using `scale <-1,1,1>` in the image map) to get
correct results.


> If not, could such a setting be added to POV-Ray? Thanks.

I intend to add an explicit "handedness" parameter to the global
settings, for more intuitive switching, including a change in the
behaviour of UV mapping and image map projection types. But it'll be a
while until I get around to that.


Post a reply to this message

From: Stephen
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 04:27:04
Message: <5ba5fcd8$1@news.povray.org>
On 22/09/2018 06:41, Mike Horvath wrote:
> Is there a way to change the handedness of a scene? I am doing a lot of 
> astronomy calculations, and they are all right handed.
> 

You could put all that Matrix maths in the Bezier-patch torus thread to use.

http://www.techart3d.com/2016/02/convert-left-handed-to-right-handed-coordinates/


> If not, could such a setting be added to POV-Ray? Thanks.
> 
> 

It was good to read clipka's reply. :)


-- 

Regards
     Stephen


Post a reply to this message

From: Mike Horvath
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 06:30:17
Message: <5ba619b9$1@news.povray.org>
On 9/22/2018 2:41 AM, Thomas de Groot wrote:
> On 22-9-2018 7:41, Mike Horvath wrote:
>> Is there a way to change the handedness of a scene? I am doing a lot 
>> of astronomy calculations, and they are all right handed.
>>
>> If not, could such a setting be added to POV-Ray? Thanks.
>>
> 
> There are different types of 'handedness' depending on which way the 
> different axis point. For Moray, which had z up and x right, the 
> following transform was used:
> 
> transform {
>    scale <1, 1, -1>
>    rotate x*90
> }
> 
> Could be used from POV->Moray or from Moray->POV.
> 
> You may have to experiment because in some cases/applications the x or 
> the z axis can point the other way round. For instance, in Silo (which 
> is left-handed) the z axis points out of the screen. The same kind of 
> things may apply to right-handed applications I guess.
> 

The problem is that I'd have to do this *each time* I define an object 
or perform a transform. Whereas a single keyword at the start of a scene 
or in an INI file would be without worry.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 06:30:59
Message: <5ba619e3$1@news.povray.org>
On 9/22/2018 4:01 AM, clipka wrote:
> I intend to add an explicit "handedness" parameter to the global
> settings, for more intuitive switching, including a change in the
> behaviour of UV mapping and image map projection types. But it'll be a
> while until I get around to that.
> 

Okay thanks.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 06:35:43
Message: <5ba61aff@news.povray.org>
On 9/22/2018 4:27 AM, Stephen wrote:
> On 22/09/2018 06:41, Mike Horvath wrote:
>> Is there a way to change the handedness of a scene? I am doing a lot 
>> of astronomy calculations, and they are all right handed.
>>
> 
> You could put all that Matrix maths in the Bezier-patch torus thread to 
> use.
> 
> http://www.techart3d.com/2016/02/convert-left-handed-to-right-handed-coordinates/ 
> 

What would I need to do for astronomy maths? In the equations I am using 
the Z and Y axes are switched.

Also, how do I multiply matrix transforms in POV-Ray?


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 11:21:59
Message: <5ba65e17$1@news.povray.org>
On 9/22/2018 6:36 AM, Mike Horvath wrote:
> On 9/22/2018 4:27 AM, Stephen wrote:
>> On 22/09/2018 06:41, Mike Horvath wrote:
>>> Is there a way to change the handedness of a scene? I am doing a lot 
>>> of astronomy calculations, and they are all right handed.
>>>
>>
>> You could put all that Matrix maths in the Bezier-patch torus thread 
>> to use.
>>
>> http://www.techart3d.com/2016/02/convert-left-handed-to-right-handed-coordinates/ 
>>
> 
> What would I need to do for astronomy maths? In the equations I am using 
> the Z and Y axes are switched.
> 
> Also, how do I multiply matrix transforms in POV-Ray?
> 
> 
> Mike

The directions of rotations also seem reversed.


Mike


Post a reply to this message

From: Stephen
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 11:55:24
Message: <5ba665ec$1@news.povray.org>
On 22/09/2018 11:36, Mike Horvath wrote:
> On 9/22/2018 4:27 AM, Stephen wrote:
>> On 22/09/2018 06:41, Mike Horvath wrote:
>>> Is there a way to change the handedness of a scene? I am doing a lot 
>>> of astronomy calculations, and they are all right handed.
>>>
>>
>> You could put all that Matrix maths in the Bezier-patch torus thread 
>> to use.
>>
>> http://www.techart3d.com/2016/02/convert-left-handed-to-right-handed-coordinates/ 
>>
> 
> What would I need to do for astronomy maths? In the equations I am using 
> the Z and Y axes are switched.
> 
> Also, how do I multiply matrix transforms in POV-Ray?
> 
> 

I might be able to help from a practical view. Blender uses the Y-up 
coord system.
Here is the output of a uv mapped mesh2 sphere, declared as DATASphere

object {
     DATASphere
     matrix <1.000000, 0.000000, 0.000000,  0.000000, -0.000000, 
-1.000000,  0.000000, 1.000000, -0.000000,  0.000000, 0.000000, 0.000000>

}

But you would either have to transform them individually or put them in 
a union and transform that.


-- 

Regards
     Stephen


Post a reply to this message

From: Stephen
Subject: Re: Global handedness setting?
Date: 22 Sep 2018 13:45:34
Message: <5ba67fbe$1@news.povray.org>
On 22/09/2018 16:22, Mike Horvath wrote:
> On 9/22/2018 6:36 AM, Mike Horvath wrote:
>> On 9/22/2018 4:27 AM, Stephen wrote:
>>> On 22/09/2018 06:41, Mike Horvath wrote:
>>>> Is there a way to change the handedness of a scene? I am doing a lot 
>>>> of astronomy calculations, and they are all right handed.
>>>>
>>>
>>> You could put all that Matrix maths in the Bezier-patch torus thread 
>>> to use.
>>>
>>> http://www.techart3d.com/2016/02/convert-left-handed-to-right-handed-coordinates/ 
>>>
>>
>> What would I need to do for astronomy maths? In the equations I am 
>> using the Z and Y axes are switched.
>>
>> Also, how do I multiply matrix transforms in POV-Ray?
>>
>>
>> Mike
> 
> The directions of rotations also seem reversed.
> 
> 
Not unexpected. That sounds like handiness. Try scale -1 * x




-- 

Regards
     Stephen


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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