POV-Ray : Newsgroups : povray.advanced-users : New random distribution macros : Re: New random distribution macros Server Time
21 Oct 2021 07:13:59 EDT (-0400)
  Re: New random distribution macros  
From: Kenneth
Date: 5 Mar 2021 10:45:01
Message: <web.60424f86296d8a3bd98418910@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:

> > It seems to me that the pixel positions of a *u-v map* of a HF might
> > somehow be used to generate the trace-from points. Since the u-v map is
> > by nature a 'stretched-out' representation of the HF itself...
> The rectangle's x,z coordinates are the exact same thing as the u,v
> coordinates of the heightfield, in terms of the fact that you can't
> subdivide the u,v's any differently than the x,z's.

Yep, I get that.

I probably used the wrong nomenclature to describe what I mean. I meant to say,
"the pixel positions of the uv TEXTURE map (the generated image_map artwork
that's made in an app like UV Mapper.) In effect, a flat representation of the
'un-wrapped' HF. To initially get the trace-from positions-- not by initially
tracing the height_field itself (although that would also need to be done as a
2nd step, I think.)

Let's say that there are two triangles on the mesh HF that butt up against each
other. Assume that triangle #1 is almost flat horizontally, so it's a nice
little equilateral triangle. But triangle #2 turns out to have a very steep
slope on the HF, with its two base-points at almost 0.0 height, but its tip way
up at almost 1.0. So that triangle is extremely 'stretched', with more surface

On the (flat) uv TEXTURE map or image_map, the 2nd triangle takes up lots more
space than triangle #1. Now assume that the final texture map has lots of these
different-sized triangluar areas.

That final image_map will have a 1X1 length-to-width ratio-- same as the
height_field square-- but obviously with some places that have NO representative
triangles on it; it's a visual representation of the un-folded HF, whatever odd
shape that turns out to be, 'pasted' onto a 1X1-ratio image size. But the lack
of triangles in some places is not really a problem for the scheme itself.

So my crazy idea is to randomly trace that TEXTURE map-- only for the 2-D
positions on it-- then to somehow correlate those found positions to the
'matching' triangles on the 3-D height_field, to finally place the greebles
during the subsequent (2nd) *HF*-tracing operation (using the typical top-down
tracing directions there, nothing fancy.) In my mind's eye, triangle
#1 will have a few 'hits', but triangle #2 will have *more* hits (because of its
larger surface area on the TEXTURE map)... in effect, making an 'even'
distribution of greeble placements on the HF itself.

Voila! Well, discounting the mathematical magic that would probably be required.

This is all conjecture, of course.

Post a reply to this message

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