POV-Ray : Newsgroups : povray.binaries.images : Realistic bricks : Re: Realistic bricks Server Time
7 Aug 2024 07:15:19 EDT (-0400)
  Re: Realistic bricks  
From: Bill Hails
Date: 2 May 2006 10:38:31
Message: <44576ee7@news.povray.org>
Bill Pragnell wrote:

> Martin Magnusson <martin@-xx-blecket-xx-.org> wrote:
>> How about using smooth_triangles instead? In the example you showed, it
>> looks like you used "flat" triangles. That should make them look
>> smoother, and probably better, at close range.
> 
> This is very true. However, I can't immediately see a way of generating
> the normals which wouldn't take an order of magnitude more work on my
> part!

generating the normals isn't all that hard.

Each vertex is touched by three or more triangles.

For each triangle you take a vector perpendicular to it's plane,
of length proportional to the length of that triangle's two edges that
intersect with the point in question (I think that's vcross() not sure
now because it's been a while).

Then you average those vectors to give you the normal at that point.

> The example mesh was intentionally low-res for illustrative purposes. In
> practice, I think it would be much easier simply to increase the
> resolution of the mesh until the triangles disappear. For really
> close-range shots, you wouldn't need many bricks. For long-range shots,
> lower-res bricks would do fine (the bricks in the wall shown above have
> the same res as the single brick, for example). For a mixture, you'd want
> to alter the resolution according to distance from the camera. All of this
> can be aided further by using copies picked from small arrays of
> pre-declared meshes to save memory.
> 
> Luckily, mesh resolution is one of the parameters in my macro!
> 
> Bill

-- 
Gee Batman, is there *anything* you don't understand?
Yes Robin, several things.


Post a reply to this message

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