POV-Ray : Newsgroups : povray.general : How to store/read the results of rotating a point in space in SDL Server Time
3 Nov 2024 01:10:30 EDT (-0400)
  How to store/read the results of rotating a point in space in SDL (Message 1 to 5 of 5)  
From: Mike the Elder
Subject: How to store/read the results of rotating a point in space in SDL
Date: 31 Oct 2008 08:20:00
Message: <web.490af6c6e21271d2ad9dd8b40@news.povray.org>
Hi folks.  After having been away from the group for a while, I was hoping to
return by posting a really neat image... However, it turns out that I could use
a bit of help producing that image.

I get the feeling that I'm missing something pretty basic in SDL.  Given the
basic nature of what it does, it SEEMS like it should be pretty easy to apply a
rotation to a point in space and get back the result as a standard vector value.

Here's an easy example:

If the point <0,10,3> is rotated 90 degrees about the y axis, the result is
<3,10,0>.

Now, I can store the value of the starting point like this:
#declare POINT1 = <0,10,3>;

....and I can use POINT1 as a value for placing objects, but...

HOW do I code:  #declare POINT2 = ???? //POINT1 rotated in a given way

I could, eventually, accomplish the rotations with a "do-it-yourself" method
based upon basic trig functions, but that seems an awful lot like re-inventing
the wheel in the middle of a wheel factory.  I'm thinking that there's GOT to
be a simple way to do this and that I'm just having an "elder moment".

Thanks in advance for all replies.

Best Regards,
Mike C.


Post a reply to this message

From: Warp
Subject: Re: How to store/read the results of rotating a point in space in SDL
Date: 31 Oct 2008 08:36:35
Message: <490afbd3@news.povray.org>
Mike the Elder <nomail@nomail> wrote:
> If the point <0,10,3> is rotated 90 degrees about the y axis, the result is
> <3,10,0>.

> Now, I can store the value of the starting point like this:
> #declare POINT1 = <0,10,3>;

> ....and I can use POINT1 as a value for placing objects, but...

> HOW do I code:  #declare POINT2 = ???? //POINT1 rotated in a given way

#declare POINT2 = vrotate(POINT1, y*90);

-- 
                                                          - Warp


Post a reply to this message

From: Mike the Elder
Subject: Re: How to store/read the results of rotating a point in space in SDL
Date: 31 Oct 2008 08:50:00
Message: <web.490afe28ceeff6f3ad9dd8b40@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Mike the Elder <nomail@nomail> wrote:
> > If the point <0,10,3> is rotated 90 degrees about the y axis, the result is
> > <3,10,0>.
>
> > Now, I can store the value of the starting point like this:
> > #declare POINT1 = <0,10,3>;
>
> > ....and I can use POINT1 as a value for placing objects, but...
>
> > HOW do I code:  #declare POINT2 = ???? //POINT1 rotated in a given way
>
> #declare POINT2 = vrotate(POINT1, y*90);
>
> --
>                                                           - Warp

That's what I kept missing (kept searching docs under "rotate").
Thanks!


Post a reply to this message

From: nemesis
Subject: Re: How to store/read the results of rotating a point in space in SDL
Date: 31 Oct 2008 11:11:15
Message: <490b2013$1@news.povray.org>
Mike the Elder escreveu:
> Warp <war### [at] tagpovrayorg> wrote:
>> Mike the Elder <nomail@nomail> wrote:
>>> If the point <0,10,3> is rotated 90 degrees about the y axis, the result is
>>> <3,10,0>.
>>> Now, I can store the value of the starting point like this:
>>> #declare POINT1 = <0,10,3>;
>>> ....and I can use POINT1 as a value for placing objects, but...
>>> HOW do I code:  #declare POINT2 = ???? //POINT1 rotated in a given way
>> #declare POINT2 = vrotate(POINT1, y*90);
>>
>> --
>>                                                           - Warp
> 
> That's what I kept missing (kept searching docs under "rotate").
> Thanks!
> 

Povray has many handy functions in the standard include files.  They are 
documented too.


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How to store/read the results of rotating a point in space in SDL
Date: 31 Oct 2008 16:18:18
Message: <490b680a@news.povray.org>
nemesis wrote:
> Povray has many handy functions in the standard include files.  They are
> documented too.

vrotate isn't even in include files, but built-in :)


Post a reply to this message

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