POV-Ray : Newsgroups : povray.beta-test : Heightfield bug (most probably an inverted normals problem) Server Time
29 Mar 2024 11:08:55 EDT (-0400)
  Heightfield bug (most probably an inverted normals problem) (Message 21 to 27 of 27)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: More info
Date: 24 Jan 2002 07:51:51
Message: <3c500367@news.povray.org>

: I can be completly offtopic but could be normal determined by order of vertices
: in triangle?

  I didn't understand this.

  The problem is not determining the normal. The problem is just that if
the angle between the incoming ray and the normal vector returned by the
object have an angle <90 degrees, the normal is inverted.
  This works just fine in most cases (and it has to be done this way). The
only problem happens with smooth triangles and smooth heightfields in certain
cases.
  As for lighting, this problem goes away by making the object
double-illuminated (because then it doesn't matter which way the normal
is pointing). However, as for the slope pattern, the solution is not so simple
(double_illuminate is used only for lighting and can't be used for slope
pattern calculation).

  By the way: In a heightfield the problem with the slope y pattern goes
away if you "mirror" the color_map around 0.5 (of course it doesn't work if
the slope is anything else than y), besides making the heightfield
double-illuminated.
  With smooth meshes which use the slope pattern there's no currently fix,
AFAIK.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From:
Subject: Re: More info
Date: 24 Jan 2002 08:01:05
Message: <n9105ugce60m3aa6lgn68e98knkimmrvjc@4ax.com>
On 24 Jan 2002 07:51:51 -0500, Warp <war### [at] tagpovrayorg> wrote:
> The problem is not determining the normal. The problem is just that if
> the angle between the incoming ray and the normal vector returned by the
> object have an angle <90 degrees, the normal is inverted.

I see, sorry then.

ABX


Post a reply to this message

From: Jérôme Grimbert
Subject: Re: More info (Was: Heightfield bug (most probably an inverted normals problem))
Date: 24 Jan 2002 09:48:07
Message: <3C501EB7.263F96C0@atosorigin.com>


> I can be completly offtopic but could be normal determined by order of vertices
> in triangle?

From memory:
In 3.1 code, the short answer is NO, at least for mesh, 
because the mesh code is free to reorder the vertices of any single triangle.(*)
So even if you carefully generate all your triangles with a +side and -side, 
once in the mesh structure it might be impossible to get back to the original
order. It's often simpler to use a smooth_triangle which allow to explicitely
specify a normal for each vertex (but take more memory, of course).

(*) and it does it, according to its own private criteria.
-- 
Non Sine Numine
http://grimbert.cjb.net/


Post a reply to this message

From: Peter Popov
Subject: Re: More info (Was: Heightfield bug (most probably an inverted normals problem))
Date: 24 Jan 2002 16:06:48
Message: <4uc05u05ad0l8ocf0mcm1vb0v1lokui2lq@4ax.com>

<abx### [at] babilonorg> wrote:

>not exactly
>I proposed this becouse I always generate meshes from triangles builded in one
>direction (ok, almost always).

Yes, but that's you. You're not the average Joe User.

>But renderer can't decide as I understand.

Yet :)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Christopher James Huff
Subject: Re: More info (Was: Heightfield bug (most probably an inverted normals problem))
Date: 24 Jan 2002 23:33:20
Message: <chrishuff-6DA92A.23343824012002@netplex.aussie.org>
In article <9uuv4uoaebc3dldemv9snhjmopultmctlj@4ax.com>,
 Peter Popov <pet### [at] vipbg> wrote:

> Then the renderer would have to trust that the order is correct, and
> that is the task of either the export utility or the scene that
> generates it. In any case the user shouldn't be doing the renderer's
> job.

No. There is no way for the renderer to reliably determine the correct 
normal, and such a mechanism would break many meshes that use the 
winding to determine it. It normally isn't a problem anyway, since POV 
renders both sides of the triangle.
And it isn't related to the height field problem, which has more to do 
with the interpolation of smooth triangle normals.

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

From: Christopher James Huff
Subject: Re: More info (Was: Heightfield bug (most probably an inverted normals problem))
Date: 24 Jan 2002 23:36:29
Message: <chrishuff-B76379.23374724012002@netplex.aussie.org>
In article <3C501EB7.263F96C0@atosorigin.com>,


> In 3.1 code, the short answer is NO, at least for mesh, 
> because the mesh code is free to reorder the vertices of any single 
> triangle.(*)
> So even if you carefully generate all your triangles with a +side and -side, 
> once in the mesh structure it might be impossible to get back to the original
> order. It's often simpler to use a smooth_triangle which allow to explicitely
> specify a normal for each vertex (but take more memory, of course).

Not true. The mesh stores the vertex *vectors* separately, the triangles 
then refer to that list. The triangles still know what order the 
vertices are in.

Proof? Use interior_texture on a mesh. The height-field macros make good 
examples...

-- 
 -- 
Christopher James Huff <chr### [at] maccom>


Post a reply to this message

From: Rune
Subject: Re: More info (Was: Heightfield bug (most probably an inverted normals problem))
Date: 6 Feb 2002 07:18:40
Message: <3c611f20@news.povray.org>
"Christopher James Huff" wrote:
> Proof? Use interior_texture on a mesh. The height-field
> macros make good examples...

And after I fixed the height-field macros you even get the interior texture
on the *inside*, contrary to how it was before... ;)

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Jan 20)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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