Jump to content

cylinder re-implementation


Recommended Posts

Hi people,


Jahow fixed the old well known cylinder light reflection artifact problem by fully re-implementing it using the ribbon which now can manage well the continuity of the light reflection along curved and closed meshes.


However the cylinder code is now quite complex because of the cylinder caps (caps aren't ribbon features) and after having hacked for a long time the computeNormals() method used by ribbons, I know now that it will be quite complex to support capped meshes under the ribbon.


This means I will probably re-implemented again the cylinder, with continuous light reflection and correct cap normals of course, from scratch.


Then only, I could have a look to the caps of the tube and the lathe (both ribbon based)... aaargg


Link to comment
Share on other sites

Do not know whether it is something to pursue or not but I needed a ribbon with caps. For the top cap I chose a point, A, within the polygon plane formed by the initial points of each path (easy in my case as initial points all in the xy plane and surrounding the origin) then added A to the beginning of each path. Same idea for bottom cap.

Link to comment
Share on other sites

That's just what I did for the tube actually ! and for extrusion with the barycenter of the model shape


But if you are looking for better normals (or no artifact), you would probably design the plane polygon "capping" the ribbon, then would add to it some normals orthogonal to this polygon and finally merge these two meshes. This is quite simple.


But if you then need to animate or morph such a capped shape, it becomes far more complex to do this 3-step operation (ribbon + polygon cap + merge) in a decent delay.


That's why, for now, I decided to keep the tube caps as they are -because of the morph/animation aspect-, it is to say like you just suggested, until I can find another way to quickly compute a real independant cap with its own normals and have everything a final single global mesh. 

Performance over accuracy... for now


The cylinder is not morphable, so we can compute dedicated caps with better normals.

Link to comment
Share on other sites



it was far more difficult than I expected initially, pffeww


So, now (once it will be merged), the Cylinder doesn't use any longer either ribbons, either computeNormals(), but a dedicated normal computation, so it avoids the tiny normal artifacts that might appear on edges.

I guess noone until now even noticed them :P


note : I kept Jahow's cylinder cap implementation

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...