|
|
|
|
|
|
| |
| |
|
|
From: Thomas Lake
Subject: Moray/Pov-Ray coordinate system converter.
Date: 28 Apr 2002 07:55:35
Message: <3ccbe337@news.povray.org>
|
|
|
| |
| |
|
|
I'm trying to write a program that converts Moray's povray output, which
uses the right hand coordinate system, to povray's native left handed
system. As you can see from the images bellow I'm not quite 1/2 way there
yet. The method I use is simply to comment out the sky and up key words in
Moray's output thereby defaulting to povray's lefthanded system. Then for
all vectors I switch the z and y positions. For example
translate <10,-50,100>
becomes
translate <10,100,-50>
This seems to work fine for translate and scale but rotation is a different
matter all together. I found a way to get rotation to work some of the time
by reversing the sign of the magnitude and rotating around the Z axis before
the y axis, so for example
rotate <-28.678608, -34.926117, 42.857418>
becomes
rotate 28.678608*x rotate 34.926117*z rotate -42.857418*y
As you can see from the image below this works for the rotated box in the
background but not for the superellipsoid in the front. Also I get all kinds
of nightmarish things happening if I try to work with csg and rotation. Can
anyone help here cause I feel like I'm close to a solution.
--
----------------------------------------------------------------------------
-----------
Home Page: http://www.geocities.com/~thomaslake/
----------------------------------------------------------------------------
-----------
Post a reply to this message
Attachments:
Download 'PovRay Before.jpg' (26 KB)
Download 'Moray Original.jpg' (27 KB)
Download 'PovRay After.jpg' (26 KB)
Preview of image 'PovRay Before.jpg'
Preview of image 'Moray Original.jpg'
Preview of image 'PovRay After.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
There is an old program out there somewhere that is called Lefter that does
the conversion. You have to make sure to change the *y and *z stuff though.
"Thomas Lake" <tla### [at] REMOVE-THISshawca> wrote in message
news:3ccbe337@news.povray.org...
> I'm trying to write a program that converts Moray's povray output, which
> uses the right hand coordinate system, to povray's native left handed
> system. As you can see from the images bellow I'm not quite 1/2 way there
> yet. The method I use is simply to comment out the sky and up key words in
> Moray's output thereby defaulting to povray's lefthanded system. Then for
> all vectors I switch the z and y positions. For example
>
> translate <10,-50,100>
>
> becomes
>
> translate <10,100,-50>
>
> This seems to work fine for translate and scale but rotation is a
different
> matter all together. I found a way to get rotation to work some of the
time
> by reversing the sign of the magnitude and rotating around the Z axis
before
> the y axis, so for example
>
> rotate <-28.678608, -34.926117, 42.857418>
>
> becomes
>
> rotate 28.678608*x rotate 34.926117*z rotate -42.857418*y
>
> As you can see from the image below this works for the rotated box in the
> background but not for the superellipsoid in the front. Also I get all
kinds
> of nightmarish things happening if I try to work with csg and rotation.
Can
> anyone help here cause I feel like I'm close to a solution.
>
> --
> --------------------------------------------------------------------------
--
> -----------
> Home Page: http://www.geocities.com/~thomaslake/
> --------------------------------------------------------------------------
--
> -----------
>
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have done that in the past with a program I wrote to convert AutoCAD
models to POV. I used much the same method, but it got a little more
complex with rotations around the y and z axes (they have to be reversed),
and I thing I remember that lathes and prisms are very messy since they can
only be defined in 2-dimensions. I can email code snippts if you're really
interested. Hope this helps your cause...
"Thomas Lake" <tla### [at] REMOVE-THISshawca> wrote in message
news:3ccbe337@news.povray.org...
> I'm trying to write a program that converts Moray's povray output, which
> uses the right hand coordinate system, to povray's native left handed
> system. As you can see from the images bellow I'm not quite 1/2 way there
> yet. The method I use is simply to comment out the sky and up key words in
> Moray's output thereby defaulting to povray's lefthanded system. Then for
> all vectors I switch the z and y positions. For example
>
> translate <10,-50,100>
>
> becomes
>
> translate <10,100,-50>
>
> This seems to work fine for translate and scale but rotation is a
different
> matter all together. I found a way to get rotation to work some of the
time
> by reversing the sign of the magnitude and rotating around the Z axis
before
> the y axis, so for example
>
> rotate <-28.678608, -34.926117, 42.857418>
>
> becomes
>
> rotate 28.678608*x rotate 34.926117*z rotate -42.857418*y
>
> As you can see from the image below this works for the rotated box in the
> background but not for the superellipsoid in the front. Also I get all
kinds
> of nightmarish things happening if I try to work with csg and rotation.
Can
> anyone help here cause I feel like I'm close to a solution.
>
> --
> --------------------------------------------------------------------------
--
> -----------
> Home Page: http://www.geocities.com/~thomaslake/
> --------------------------------------------------------------------------
--
> -----------
>
>
>
Post a reply to this message
|
|
| |
| |
|
|
From: Thomas de Groot
Subject: Re: Moray/Pov-Ray coordinate system converter.
Date: 30 Apr 2002 02:59:31
Message: <3cce40d3$1@news.povray.org>
|
|
|
| |
| |
|
|
Hmm... See my message/work-around in moray.win.
I think my work-around there might also help with lathes and prisms? I don't
think I tried, but it should work the same as for any CSG object...
Anyway, the conversion is only intended for a group of objects? Not a whole
scene? because that would not make really sense as the end result would be
the same, whether traced in Moray or POV-Ray...
Thomas de Groot
"cadman" <cad### [at] graffitinet> schreef in bericht
news:3ccd5bc7$2@news.povray.org...
> I have done that in the past with a program I wrote to convert AutoCAD
> models to POV. I used much the same method, but it got a little more
> complex with rotations around the y and z axes (they have to be reversed),
> and I thing I remember that lathes and prisms are very messy since they
can
> only be defined in 2-dimensions. I can email code snippts if you're
really
> interested. Hope this helps your cause...
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|