Jump to content

Ribbons and lighting


lesterhaus
 Share

Recommended Posts

Hey everyone!

Apparently I didn't quite understand how ribbons work, even after reading the extensive tutorials.

I've set up a playground with a very basic ribbon made from 2 Vector3 arrays (base and heights) gave the whole thing a material and set a box next to it to further illustrate my problem.

http://www.babylonjs-playground.com/#1HLWTQ#4

 

Since I'm not a 3D programming crack, could any of you explain what causes that weird lighting? Is this be a face- or vertex-normal problem? Does it happen because I build the ribbon the wrong way?

Where did I go wrong? :)

Cheers, Lesterhaus

 

p.s.: Please forgive the weird xyz-coordinates used - I'm working on a demo where I send batches of drawcommands to babylon js for extrusion and just copy/pasted it into the playground for tests

Link to comment
Share on other sites

Well, not sure if that's explanation enough, but if you convert your mesh to flat shaded, it looks like the cube: http://www.babylonjs-playground.com/#1HLWTQ#5

I think ribbons are basically intended for rounded surfaces so it starts of as ..well.. not flat shaded :P But as you can see, you can easily convert it. Does that help?

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.

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

Loading...
 Share

  • Recently Browsing   0 members

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