POV-Ray : Newsgroups : povray.advanced-users : Trace, Normal: a problem Server Time
30 Jul 2024 02:19:37 EDT (-0400)
  Trace, Normal: a problem (Message 1 to 9 of 9)  
From: SamuelT
Subject: Trace, Normal: a problem
Date: 28 Jun 2000 12:45:29
Message: <395A2C86.6EDCD317@aol.com>
Hello. I have a problem regarding the MegaPOV feature, 'trace' and
surface normals detected by it. I want to rotate objects according to
the surface normal, to get boxes or other objects to stick out
perpendicular from slanted surfaces. Here is what I tried, using
information for the surface normal from trace:

rotate < Norm.z*90, 0, Norm.x*90 >

In my code the rays are shot straight down onto an object. Boxes are
placed onto the surface of the object and rotated to near accuracy,
but.... The problem is that they aren't rotated precisely! Sure, on the
more horizontal parts boxes are straight up and down, and sure, on the
vertical parts of the object the boxes are placed horizonally...but all
the ones in between down remain perpendicular to the objects' surface! I
don't get it. Is it a bug with the MegaPOV code? Is it a bug wth my own
code?

Thanks in advance. I'll post code and an image describing the problem
later, if anyone who is willing to help needs to know exactly what it
looks like.

~Sam


Post a reply to this message

From: Chris Huff
Subject: Re: Trace, Normal: a problem
Date: 28 Jun 2000 13:40:14
Message: <chrishuff-84140E.12401628062000@news.povray.org>
In article <395A2C86.6EDCD317@aol.com>, STB### [at] aolcom wrote:

> Hello. I have a problem regarding the MegaPOV feature, 'trace' and
> surface normals detected by it. I want to rotate objects according to
> the surface normal, to get boxes or other objects to stick out
> perpendicular from slanted surfaces. Here is what I tried, using
> information for the surface normal from trace:
> 
> rotate < Norm.z*90, 0, Norm.x*90 >

That code is wrong. The normal values aren't angles, the normal is an 
ordinary vector. The usual way of doing it is to use a matrix transform, 
try using one of the ReOrient macros drifting around.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: SamuelT
Subject: Re: Trace, Normal: a problem
Date: 28 Jun 2000 14:26:13
Message: <395A4421.D24D010F@aol.com>
Chris Huff wrote:

> That code is wrong. The normal values aren't angles, the normal is an
> ordinary vector. The usual way of doing it is to use a matrix transform,
> try using one of the ReOrient macros drifting around.

I thought the matrix transform was only good for skewing things.... Do you
use the normal vector somehow in the matrix transform? What does the
reorient macro do (and where can I find it)?

Thanks,

~Sam


Post a reply to this message

From: Chris Huff
Subject: Re: Trace, Normal: a problem
Date: 28 Jun 2000 15:02:47
Message: <chrishuff-F4429A.14025028062000@news.povray.org>
In article <395A4421.D24D010F@aol.com>, STB### [at] aolcom wrote:

> I thought the matrix transform was only good for skewing things.... Do you
> use the normal vector somehow in the matrix transform? What does the
> reorient macro do (and where can I find it)?

http://users.erols.com/vansickl/macs.htm

And while you are at it, you might want to check out his matrix tutorial:
http://users.erols.com/vansickl/matrix.htm

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: SamuelT
Subject: Re: Trace, Normal: a problem
Date: 28 Jun 2000 15:23:36
Message: <395A5196.91FC06A@aol.com>
Thanks! That matrix tutorial is even better than having he macro alone. FYI, I
need the macro for some ground cover experiments, probably resulting in another
memory-intensive macro :)

~Sam

Chris Huff wrote:

> In article <395A4421.D24D010F@aol.com>, STB### [at] aolcom wrote:
>
> > I thought the matrix transform was only good for skewing things.... Do you
> > use the normal vector somehow in the matrix transform? What does the
> > reorient macro do (and where can I find it)?
>
> http://users.erols.com/vansickl/macs.htm
>
> And while you are at it, you might want to check out his matrix tutorial:
> http://users.erols.com/vansickl/matrix.htm
>
> --
> Christopher James Huff - Personal e-mail: chr### [at] maccom
> TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
> Personal Web page: http://homepage.mac.com/chrishuff/
> TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Mark Wagner
Subject: Re: Trace, Normal: a problem
Date: 29 Jun 2000 01:50:13
Message: <395ae395@news.povray.org>
SamuelT wrote in message <395### [at] aolcom>...
>Thanks! That matrix tutorial is even better than having he macro alone.
FYI, I
>need the macro for some ground cover experiments, probably resulting in
another
>memory-intensive macro :)


You might want to look at the "vegetate" include file for reference:
http://www.geocities.com/rengaw03/povray.html

Mark


Post a reply to this message

From: Warp
Subject: Re: Trace, Normal: a problem
Date: 29 Jun 2000 05:57:37
Message: <395b1d91@news.povray.org>
SamuelT <STB### [at] aolcom> wrote:
: I thought the matrix transform was only good for skewing things....

  Matrix can do EVERYTHING! :)


  "Unfortunately no-one can be told what the matrix is... You have to see
it for yourself." - Morpheus, The Matrix.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Christoph Hormann
Subject: Re: Trace, Normal: a problem
Date: 29 Jun 2000 09:51:21
Message: <395B545B.A3DFD8B5@schunter.etc.tu-bs.de>
Warp wrote:
> 
>   Matrix can do EVERYTHING! :)
> 

Only *linear* transformations!


>   "Unfortunately no-one can be told what the matrix is... You have to see
> it for yourself." - Morpheus, The Matrix.
> 

"Don't try to bend the spoon, that's impossible, try to realize the obvious..."
;-)

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Tony[B]
Subject: Re: Trace, Normal: a problem
Date: 29 Jun 2000 19:59:07
Message: <395be2cb@news.povray.org>
>   "Unfortunately no-one can be told what the matrix is... You have to see
> it for yourself." - Morpheus, The Matrix.

"Do you think that's air you're breathing...?"


Post a reply to this message

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