View Full Version : pntBaseNormal Problem

01-02-2009, 08:41 AM

I have troubles receiving a point's normals with the 'pntBaseNormal' and also the 'pntOtherNormal' function which is described in the Lightwave SDK as part of the 'LWMeshInfo' struct.
I received a pointer to this struct through the 'LWObjectFuncs::layerMesh' function.
It seems that 'pntBaseNormal' and 'pntOtherNormal', although returning a value of 1, don't do what they're supposed to according to the SDK documentation. The surface which is assigned to the corresponding polygons has no smoothing behaviour, yet every normal that is returned to my plugin seems to be smoothed with all surrounding polygons resulting in incorrect normal values.
The polygon ID given to 'pntBaseNormal' and 'pntOtherNormal' is valid, because I use those functions within the execution of a polygon scan routine and all the other data I get is just fine.
Is there something I didn't get right? Or is it a known problem at all?

Jan Panier

01-02-2009, 08:12 PM
Do you have wireframe mode enabled in Layout? And no texture mode in any viewport? Then it's the answer - LW optimize calculations of normals by simply skipping this stage, if viewports won't use normals in OpenGL.. Very serious design flow, if you ask me.. Real-time rendering engines like Fprime and TrueHair Preview, or even stand-alone renderers like Kray, need normals from LW..

01-03-2009, 11:26 AM
Newtek added a fix to this in RC1. Read the release info:

"In the SDK: Added a new command called "CalculateAllNormals" that will force all the normals to evaluate. This would be used by external renderers, and should only be used when needed to render, and then deactivated, as it impacts Layout performance.

1. Issue "CalculateAllNormals 1" to turn on the mode.
2. Render
3. Issue "CalculateAllNormals 0" to turn it off.

The animate command is called after this command, so that all the geometry is evaluated. The boolean value of the state of the command has been added to the end of the sceneinfo structure, so it can be checked before you change its state."

01-04-2009, 08:49 AM
thanks a lot for your replies! i will immediately try if it works.

btw: I had texture mode in the perspective viewport, which was active at the time i used my plugin, so i'm afraid that wasn't the answer :-(