Jump to content

updateMeshPositions as Normal Calculator?


Recommended Posts

Quick question, I am about to test it but I am working on some other stuff for the next hour or so and before I get to this problem I figured I would ask the community.


I have a Theory that if I use:

updateMeshPositions(positionFunction, computeNormals)

and in the function just tell it that positions = positions or even skip that step and literally, just call the function with the flag computeNormals if it will update the normal data on the mesh?

I kinda doubt it because I am assuming that the new normal data come from the manipulation of the Vertices in the function itself as it propagates.

Is there a way to push the results of a VertexData manipulation to also update the Normals, I know its not inherent because I have logged the response after manipulation and it is the same as before.


Yea I guess it does work... after you manipulate the vertexData just pass the mesh through Mesh.updateMeshPositions(function(){}, true); and you will update the normals...


Edited by Pryme8
Link to comment
Share on other sites


of course, it works ;-)

it's used in the code of many morphable parametric shapes !


if you need to check, just use this : https://github.com/BabylonJS/UserFunctions/blob/master/showNormals.js


btw, the new LineSystem could now be used in showNormals.js

Link to comment
Share on other sites

I guess I do not understand the PG, and yea I am dependent on some separate js files for the noise algorithms, but if I can include them then its on.

EDIT* And Jquery

also looking at the playground I dont see the option to attach external files or edit the head section of the page...

Ill post on my github if its a problem to get it on the playground

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...