Jump to content

Lighting a Triangle


mtmckenna
 Share

Recommended Posts

Hello everyone,

I'm getting started with Babylon.js, and I'm having trouble understanding how lighting works re: ribbons.

I've created a triangle using a ribbon here, but triangle is completely black: http://babylonjs-playground.com/#2JDZGR

However, if I add an extra point to the ribbon, the triangle is suddenly lit: http://babylonjs-playground.com/#2JDZGR#1

Any ideas on what's going on?

Thank you!

Link to comment
Share on other sites

please read this first to understand what is really a ribbon : http://doc.babylonjs.com/tutorials/Parametric_Shapes

here, you pass a single path with only 3 points.. have a read please at what is a ribbon with a single path, what is a really specific case (you can't do a triangle that way)

I'm not sure to understand what you want to achieve, but usually ribbons have at least 2 paths, each at least with 2 points (minimum to get a real ribbon and no specific hard to deal with case)

If you want to draw a triangle, you should consider CreateDisc (yep, disc !) with tessellation = 3   : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#disc

http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements

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