[vtkusers] Set vertex normals ?

David E DeMarle dave.demarle at kitware.com
Mon Nov 2 17:50:05 EST 2015


Took me a minute to find it.

On Sat, Oct 24, 2015 at 2:32 AM, Ronald Levine <rl at quantcomp.com> wrote:

> normals.SetNumberOfComponents(3)
> normals.SetNumberOfTuples(4)
>

Normals looks something like this at this point .
[0,0,0]
[0,0,0]
[0,0,0]
[0,0,0]

normals.InsertNextTuple3(0.,0.,1.)
> normals.InsertNextTuple3(0.,0.,1.)
> normals.InsertNextTuple3(0.,0.,1.)
> normals.InsertNextTuple3(0.,0.,1.)
>

now it looks like this
[0,0,0]
[0,0,0]
[0,0,0]
[0,0,0]

> [0,0,1]
[0,0,1]
[0,0,1]
[0,0,1]

Thus the mapper never saw what you wanted it too.

To fix, take the SetNumberOfTuples() call out and use keep letting
InsertNext append to the initially empty array, or better yet keep
SetNumberOfTuples and then use SetTuple3(idx, vx,vy,vz) for faster
non-checked inserts.



David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151102/ed412437/attachment.html>


More information about the vtkusers mailing list