POV-Ray : Newsgroups : povray.general : A problem with height field intersection algorithm Server Time
6 Nov 2024 06:23:41 EST (-0500)
  A problem with height field intersection algorithm (Message 1 to 4 of 4)  
From: Johannes Dahlstrom
Subject: A problem with height field intersection algorithm
Date: 15 Oct 2002 13:55:41
Message: <3dac569c@news.povray.org>
Hi,

I'm implementing the height field object to my ray tracer and reasoned that 
I should use a line drawing algorithm to check the ray against exactly 
those triangles which lie along its path. I chose the Bresenham's algorithm 
because of its speed. It didn't quite work: there were holes in the height 
field. After some thinking I realized that it is because the fractional 
parts of the entry and exit coordinates (in "pixel" units) matter, and the 
standard algorithm didn't take them into account. I'd like some hints on 
how to do that. Perhaps calculating somehow an initial value for the 
Bresenham's "error" variable? Or should I take an entirely different 
approach?

I'll post an illustration of the problem to p.b.i shortly. It'll probably 
be more descriptive than my text above ;).      

-Johannes


Post a reply to this message

From: Johannes Dahlstrom
Subject: Re: A problem with height field intersection algorithm
Date: 21 Oct 2002 10:17:20
Message: <3db40c6f@news.povray.org>
Well, judging by the acute lack of follow-ups to this poor 
excuse-for-a-thread, it seems that the topic isn't the easiest one in the 
world. Even the results of an intensive Google session were pretty much 
non-existent :( Looking into the POV sources, I think the heightfield code 
there does more or less the same thing as I presented, but I didn't 
understand much of it (there's _lots_ of code in the intersection test).


Post a reply to this message

From: Christopher James Huff
Subject: Re: A problem with height field intersection algorithm
Date: 21 Oct 2002 12:03:41
Message: <chrishuff-6D0BDF.11585721102002@netplex.aussie.org>
In article <3db40c6f@news.povray.org>,
 Johannes Dahlstrom <sad### [at] tkukoulufi> wrote:

> Well, judging by the acute lack of follow-ups to this poor 
> excuse-for-a-thread, it seems that the topic isn't the easiest one in the 
> world. Even the results of an intensive Google session were pretty much 
> non-existent :( Looking into the POV sources, I think the heightfield code 
> there does more or less the same thing as I presented, but I didn't 
> understand much of it (there's _lots_ of code in the intersection test).

Well, part of the reason might be that this is the wrong group...for 
programming discussion, povray.programming might be a better choice. For 
general non-POV graphics programming, try the USENET group 
comp.graphics.algorithms.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Johannes Dahlstrom
Subject: Re: A problem with height field intersection algorithm
Date: 21 Oct 2002 12:41:20
Message: <3db42e2f@news.povray.org>
Christopher James Huff wrote:

> Well, part of the reason might be that this is the wrong group...for
> programming discussion, povray.programming might be a better choice. For
> general non-POV graphics programming, try the USENET group
> comp.graphics.algorithms.

I was quite unsure which group (if any) would be appropriate, and selected 
p.g instead of p.p because my question was more about an algorithm than its 
actual implementation. Besides, I thought that most people reading p.p also 
read p.g... But I think I'll give the comp.graphics.algorithms a try, 
thanks for the tip :)


Post a reply to this message

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