POV-Ray : Newsgroups : povray.general : Ray intersection test: Can't get my epsilon value right. I think. Server Time
4 Nov 2024 23:15:33 EST (-0500)
  Ray intersection test: Can't get my epsilon value right. I think. (Message 1 to 5 of 5)  
From: [GDS|Entropy]
Subject: Ray intersection test: Can't get my epsilon value right. I think.
Date: 6 Feb 2009 14:55:19
Message: <498c95a7@news.povray.org>
Greetings,

I am working with the ray intersection macro provided by triple_r, which 
works well, but I can't seem to get my epsilon value right. I think. Or I'm 
doing something else wrong...maybe. (thought I'd just post the question with 
the image, instead of three seperate posts to three seperate forums[image, 
source and question, respectively]...seemed a better choice..apologies if I 
was wrong)

What seems to happen is that with epsilon of 1.0-e10, only 1/2 of the glows 
are drawn, including the wrong ones. Using 1.0e-1 I can get all of the glows 
to draw, including the wrong ones. Values in between change little.

The ray intersection method seems to work fine for a single object like a 
cube at e-10. Additionally it does not appear to matter which object I test 
against.

Any ideas?

ian


Post a reply to this message


Attachments:
Download 'glowthruObjectFix_Test_2.pov.txt' (5 KB) Download 'glowthruObjectFix_Test_2.gif' (34 KB)

Preview of image 'glowthruObjectFix_Test_2.gif'
glowthruObjectFix_Test_2.gif


 

From: triple r
Subject: Re: Ray intersection test: Can't get my epsilon value right. I think.
Date: 6 Feb 2009 22:30:01
Message: <web.498cff5b40536681ef2b9ba40@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> Greetings,
>
> I am working with the ray intersection macro provided by triple_r, which
> works well, but I can't seem to get my epsilon value right. I think. Or I'm
> doing something else wrong...maybe. (thought I'd just post the question with
> the image, instead of three seperate posts to three seperate forums[image,
> source and question, respectively]...seemed a better choice..apologies if I
> was wrong)
>
> What seems to happen is that with epsilon of 1.0-e10, only 1/2 of the glows
> are drawn, including the wrong ones. Using 1.0e-1 I can get all of the glows
> to draw, including the wrong ones. Values in between change little.
>
> The ray intersection method seems to work fine for a single object like a
> cube at e-10. Additionally it does not appear to matter which object I test
> against.

Uh oh.  I think it is likely that 1e-10 may just be too small.  Or is it
possible that the sign may need to be changed?  The whole idea of some
tolerance was that the glow should be drawn even if it is coincident with the
surface, so you need to add a small amount to the distance to the surface when
you compare it to the distance to the glow.  I wrote it very quickly and only
tested it with that case, but it seems something between the two *should* work.
 Of course if the phony epsilon is less than the real epsilon, it's useless.
Without a concrete, simple example of where it fails, it's hard to say.  My
advice would be to go through the macro very carefully and get a firm grasp on
the vector math.  The trace function is not so bad once you understand what it
is doing:

http://www.povray.org/documentation/view/3.6.1/229/

 - Ricky


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: Ray intersection test: Can't get my epsilon value right. I think.
Date: 6 Feb 2009 23:17:39
Message: <498d0b63$1@news.povray.org>
Hello, (and thank you for the macro! I hadn't even a clue where to start 
before.)

Any suggestions as to how I might more adequately simplify my example file?

Hmm...obviously I must attempt further absorbtion of the povdocs...though I 
do find them somewhat obfuscated in their delineation..
I found those accompanying pov 3.0 much easier to understand.

Ahh...vector math...

*ian looks at his TI-86 titanium*
*his TI-86 stares back, malevolently*
*ian hides*

Yes...about that...I guess I must get used to it at some point, given that 
differential calculus...and worse...are but a few semesters away..

*ian hides again*

X_x'

Those povdocs are so...wordy...and sparse on examples...
I mean, once I've got the concept, I've got it...but...what a mire of 
text...(not that I'm any better at documentation of functionality 
myself...actually I'm horrbile at it...ok...I let VS2k5 do it all...)

Oh well...such are the perils of attempting ot intuit the esoterica of a 
program you didn't write...

I guess I need to track down every scene file using vtransform, vnormalize, 
trace and etc.. that I can find and begin vivisection...

Everyone, feel free to initiate a .pov file deluge at the following address: 
gds### [at] hotmailcom ...should you be willing...

Thanks,
ian
*continues to hide from the TI-86*

"triple_r" <nomail@nomail> wrote in message 
news:web.498cff5b40536681ef2b9ba40@news.povray.org...
> "[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
>> Greetings,
>>
>> I am working with the ray intersection macro provided by triple_r, which
>> works well, but I can't seem to get my epsilon value right. I think. Or 
>> I'm
>> doing something else wrong...maybe. (thought I'd just post the question 
>> with
>> the image, instead of three seperate posts to three seperate 
>> forums[image,
>> source and question, respectively]...seemed a better choice..apologies if 
>> I
>> was wrong)
>>
>> What seems to happen is that with epsilon of 1.0-e10, only 1/2 of the 
>> glows
>> are drawn, including the wrong ones. Using 1.0e-1 I can get all of the 
>> glows
>> to draw, including the wrong ones. Values in between change little.
>>
>> The ray intersection method seems to work fine for a single object like a
>> cube at e-10. Additionally it does not appear to matter which object I 
>> test
>> against.
>
> Uh oh.  I think it is likely that 1e-10 may just be too small.  Or is it
> possible that the sign may need to be changed?  The whole idea of some
> tolerance was that the glow should be drawn even if it is coincident with 
> the
> surface, so you need to add a small amount to the distance to the surface 
> when
> you compare it to the distance to the glow.  I wrote it very quickly and 
> only
> tested it with that case, but it seems something between the two *should* 
> work.
> Of course if the phony epsilon is less than the real epsilon, it's 
> useless.
> Without a concrete, simple example of where it fails, it's hard to say. 
> My
> advice would be to go through the macro very carefully and get a firm 
> grasp on
> the vector math.  The trace function is not so bad once you understand 
> what it
> is doing:
>
> http://www.povray.org/documentation/view/3.6.1/229/
>
> - Ricky
>
>


Post a reply to this message

From: triple r
Subject: Re: Ray intersection test: Can't get my epsilon value right. I think.
Date: 7 Feb 2009 00:10:01
Message: <web.498d156d40536681ef2b9ba40@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> Hello, (and thank you for the macro! I hadn't even a clue where to start
> before.)
>
> Any suggestions as to how I might more adequately simplify my example file?

Start simple.  Learn the basics of vector/matrix math for 3D graphics.  Here's a
good
start:

http://chortle.ccsu.edu/VectorLessons/vectorIndex.html

This one is more relevant to POV-Ray:

http://www.geocities.com/evilsnack/matrix.htm

Then try out a couple scenes applying the basics.  Everything else is just
details.  Don't avoid vectors or calculus either.  I started early and it was
worth every second.  Here's an example scene of how to apply the same
transformation to a point and an object.  Then try the trace function by
pointing a vector at a sphere and drawing something at the resulting point.
Once you have the basics down, you can do anything you want.

 - Ricky


// VTRANSFORM SAMPLE
#include "transforms.inc"

camera{
    orthographic
    location <0,0,-2>
    look_at <0,0,0>
}

global_settings{ ambient_light 10.0 }

// Arrow going from <0,0,0> to <0,1,0>:
#declare arrow =
    union{
        cylinder{0, y*0.9, 0.025}
        cone{y*0.9, 0.05, y, 0}
        pigment{rgb x}
    }

// Vector pointing to the tip of the arrow
#declare tip_pt = <0,1,0>;

// Make a new transformation
#declare rotate_trans =
    transform{
        rotate <0,0,-35>
    }

// Apply the transformation to the OBJECT and draw the arrow
object{
    arrow
    transform{ rotate_trans }
}

// Apply the transformation to the POINT and draw a sphere there
sphere{
    vtransform( tip_pt, rotate_trans ), 0.02
    pigment{rgb y}
}


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: Ray intersection test: Can't get my epsilon value right. I think.
Date: 7 Feb 2009 01:25:30
Message: <498d295a$1@news.povray.org>
Thank you!

I didn't even know where to start looking; those povdocs are an enigma 
wrapped in a puzzle buried in a labyrinth...not at all like the 3.0 docs...

And I'll still accept a pov file deluge. :-D

*downloads those websites*

ian

"triple_r" <nomail@nomail> wrote in message 
news:web.498d156d40536681ef2b9ba40@news.povray.org...
> "[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
>> Hello, (and thank you for the macro! I hadn't even a clue where to start
>> before.)
>>
>> Any suggestions as to how I might more adequately simplify my example 
>> file?
>
> Start simple.  Learn the basics of vector/matrix math for 3D graphics. 
> Here's a
> good
> start:
>
> http://chortle.ccsu.edu/VectorLessons/vectorIndex.html
>
> This one is more relevant to POV-Ray:
>
> http://www.geocities.com/evilsnack/matrix.htm
>
> Then try out a couple scenes applying the basics.  Everything else is just
> details.  Don't avoid vectors or calculus either.  I started early and it 
> was
> worth every second.  Here's an example scene of how to apply the same
> transformation to a point and an object.  Then try the trace function by
> pointing a vector at a sphere and drawing something at the resulting 
> point.
> Once you have the basics down, you can do anything you want.
>
> - Ricky
>
>
> // VTRANSFORM SAMPLE
> #include "transforms.inc"
>
> camera{
>    orthographic
>    location <0,0,-2>
>    look_at <0,0,0>
> }
>
> global_settings{ ambient_light 10.0 }
>
> // Arrow going from <0,0,0> to <0,1,0>:
> #declare arrow =
>    union{
>        cylinder{0, y*0.9, 0.025}
>        cone{y*0.9, 0.05, y, 0}
>        pigment{rgb x}
>    }
>
> // Vector pointing to the tip of the arrow
> #declare tip_pt = <0,1,0>;
>
> // Make a new transformation
> #declare rotate_trans =
>    transform{
>        rotate <0,0,-35>
>    }
>
> // Apply the transformation to the OBJECT and draw the arrow
> object{
>    arrow
>    transform{ rotate_trans }
> }
>
> // Apply the transformation to the POINT and draw a sphere there
> sphere{
>    vtransform( tip_pt, rotate_trans ), 0.02
>    pigment{rgb y}
> }
>
>
>
>
>
>
>


Post a reply to this message

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