POV-Ray : Newsgroups : povray.general : Problem with normals? in mesh2 Server Time
2 Nov 2024 03:14:30 EDT (-0400)
  Problem with normals? in mesh2 (Message 1 to 5 of 5)  
From: gregjohn
Subject: Problem with normals? in mesh2
Date: 9 May 2010 18:25:00
Message: <web.4be7359eae8b1efd34d207310@news.povray.org>
Hi, I have a mesh2 for which I've uploaded an animation of it rotating and
trashing about: ( http://www.youtube.com/watch?v=XI1vwkjvtFY ).  This isn't as
much a question about my animation style or about how I made an image, per se,
but about modeling with povray.

The mesh2 is largely an extruded circle, I just bend the spline which forms its
spine and/or change the shape and radius of the extruding hula hoop.  It's
largely based on Mike Williams' mesh includes.

There appears to be a problem in that it is unnaturally dark (IMO) on parts of
the surface seen at high incident angle.  My normals are calculated merely as
being normal to the SPINE, not considering all the points of all the triangles
around a pohint.   That would be harder math, but is it necessary?  I'm pretty
sure this is a real problem and not a function of bad lighting design.


Post a reply to this message

From: Slime
Subject: Re: Problem with normals? in mesh2
Date: 9 May 2010 20:50:17
Message: <4be75849@news.povray.org>
> My normals are calculated merely as
> being normal to the SPINE, not considering all the points of all the 
> triangles
> around a pohint.   That would be harder math, but is it necessary?

Yeah, that's your problem. The lighting is wrong because the normals are 
wrong. Note that the worst of the lighting problems happen where the 
direction from the spine is significantly different from the actual normal, 
like on the sides of the shoulders and the top of the head.

 - Slime


Post a reply to this message

From: gregjohn
Subject: Re: Problem with normals? in mesh2
Date: 10 May 2010 19:15:00
Message: <web.4be892a6ba33d76a34d207310@news.povray.org>
Thanks!  I tried simply turning off the normals and it looked better.


But what would I have to do to make a value-add normal?  Take the case of mesh2
that is a torus (or an arbitrary bend if you're tempted to tell me the math for
a torus' normal).  I'm guessing having my normal be merely "normal" to the
triangle itself would be pointless.  But how many surrounding points would I
need to use-- the eight surrounding points, or what?


Post a reply to this message

From: Alain
Subject: Re: Problem with normals? in mesh2
Date: 10 May 2010 19:52:43
Message: <4be89c4b$1@news.povray.org>

> Thanks!  I tried simply turning off the normals and it looked better.
>
>
> But what would I have to do to make a value-add normal?  Take the case of mesh2
> that is a torus (or an arbitrary bend if you're tempted to tell me the math for
> a torus' normal).  I'm guessing having my normal be merely "normal" to the
> triangle itself would be pointless.  But how many surrounding points would I
> need to use-- the eight surrounding points, or what?
>
>
>
>
>
>

In most cases, it's the average of the normals at the center of the 
triangles touching the point. If not the actual average, then reasonably 
close to that.

Depending on the situation, 3 points can be enough, but you probably 
need to use 6 points, and sometimes, 8 or more. Use the vertices that 
connect to a point.



Alain


Post a reply to this message

From: Warp
Subject: Re: Problem with normals? in mesh2
Date: 11 May 2010 07:36:55
Message: <4be94157@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> In most cases, it's the average of the normals at the center of the 
> triangles touching the point. If not the actual average, then reasonably 
> close to that.

  Calculating vertex normal vectors by averaging the normals of the
triangles sharing that vertex (possibly weighted by the area of the
triangle) is a common way of smoothing a mesh when the only available
information is the raw triangle set.

  In theory if the mesh has been created from a mathematical surface
(eg. an isosurface, a NURBS or some other algorithmically created surface)
the optimal vertex normal would be the true normal of that mathematical
surface at that point. Of course this requires that you can figure out
the math to calculate the normal at any point on the surface (often this
requires derivatives, although sometimes it can be deduced by the way
the mesh is generated).

-- 
                                                          - Warp


Post a reply to this message

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