Results 1 to 4 of 4

Thread: pntBaseNormal Problem

  1. #1

    pntBaseNormal Problem

    Hello,

    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?

    Regards,
    Jan Panier

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,795
    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..
    LightWave Plugins
    Global Materials for LightWave 2019
    Custom plugin writing. Request a quote.

  3. #3
    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."

  4. #4
    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 :-(
    Last edited by havoc_dlt; 01-04-2009 at 08:57 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •