Mon 28 Aug 2017 11:30:49 AM UTC, comment #2:
Hi Markus, thank you for your reply, it is indeed useful and I'm sure will solve my problem, at least in the workaround sense. At least now I know the underlying cause for the fault, and I'm better informed on how lighting works, and can have a stab at it.
However, I'm of the opinion that it would be best to restore the original title, and simply close this particular bug under an appropriate status, and then start a new one with the title you suggested (perhaps linking the two during this process). Otherwise anyone coming to the bug tracker with the same bug / question is unlikely to find this discussion via such a title, unless they know what the problem is (which by definition they wouldn't), and may even submit unnecessary duplicate bugs.
|
Mon 28 Aug 2017 11:18:51 AM UTC, comment #1:
For lighting to work on patches, you need to define the "facenormals" or "vertexnormals" property manually. Some functions like sphere or isosurface set these properties. Thus, lighting works "out of the box" with them.
A while back I did some steps towards automatically calculating the normals from the face vertices in patch #8951. I don't know whether that patch would still apply.
In the meantime, you could manually calculate the facenormals e.g. by using the cross product of two face edges.
Marking this as a feature request and changing the title accordingly.
|
Sun 27 Aug 2017 08:20:15 PM UTC, original submission:
Attempting to add a light source to a patch object does not work.
Adding a light to other types of plot (e.g. surface) works.
Creating a patch object automatically, e.g. using isosurface, also works. Removing the light source and then adding another one in an object which previously supported lighting works as intended, e.g.:
But attempting to create a patch object from scratch and then add light, doesn't seem to have an effect.
Example:
I'm not sure if this bug is related: https://savannah.gnu.org/bugs/?42006 (referring specifically to the line "It looks like 'glEnable (LIGHTING)' should only be called for patches and surfaces if a light object is present in the axes")
|