POV-Ray : Newsgroups : povray.general : Understanding isosurface, difference between negative and positive : Re: Understanding isosurface, difference between negative and positive Server Time
28 Jul 2024 22:22:18 EDT (-0400)
  Re: Understanding isosurface, difference between negative and positive  
From: Louis
Date: 4 Jan 2014 20:30:01
Message: <web.52c8b427b61b6914cbe7ea7c0@news.povray.org>
Doctor John <j.g### [at] gmailcom> wrote:
> On 28/12/13 16:39, Louis wrote:
> >
> > Thanks! that cleared it up! I looked over the fact that squared dimensions are
> > always positive. Ouch.
> >
>
> We've all done it (or something similar)
>
> John
> --
> Protect the Earth
> It was not given to you by your parents
> You hold it in trust for your children

I must be doing something similar again, I've spent some hours looking, but I
can't spot my error:

// Rotate a position 1 km above earths surface to some coordinate
#declare test=vrotate(<0,0,-6372>, <35.201352,111.639249,0>);

#debug concat("position = <",str(test.x,0,3),
",",str(test.y,0,3),",",str(test.z,0,3), ">\n")

#debug
concat("height=",str(pow(pow(test.x,3)+pow(test.y,3)+pow(test.z,3),(1/3)),0,3),
"\n") // This should be 6372, rotating about the origin <0,0,0>

The result is:
position = <-4839.809,3673.150,1920.052>
height=-1.#IO

I'm not sure why height is printed out like that (-1.#IO), is it trying to use
imaginary numbers? Any way, if I calculate it on a calculator:

cube(4839.809) + cube(3673.15) + cube(1920.052) = 170003198137.853207737
cuberoot(170003198137,853207737) = 5539,6929949498910498665819311567

So how did my altitude get burried down under the earths crust in hot lava? I'd
expect the length of the vector to stay 6372, regardless of how it rotates.

Am I misunderstanding vrotate? When I do:
{
translate <0,0,-6372>
rotate <35.201352,111.639249,0>
}
It does end up at the expected location.

The reason I want to use vrotate, is because I want the camera's look_at
position to be at that location (and I can't translate and rotate the look_at
position without translating and rotating the entire camera).

What am I missing?


Post a reply to this message

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