mtmckenna Posted February 27, 2016 Share Posted February 27, 2016 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! Quote Link to comment Share on other sites More sharing options...
gryff Posted February 27, 2016 Share Posted February 27, 2016 Both work fine - triangle lit - for me mtmckenna Viewd in latest FF. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Temechon Posted February 27, 2016 Share Posted February 27, 2016 In Chrome, the triangle is all black for information. Quote Link to comment Share on other sites More sharing options...
mtmckenna Posted February 27, 2016 Author Share Posted February 27, 2016 Weird! You folks aren't seeing something like the attached screenshot with a lit sphere and a black triangle? I took the screenshot in Safari. Quote Link to comment Share on other sites More sharing options...
gryff Posted February 27, 2016 Share Posted February 27, 2016 Quote In Chrome, the triangle is all black for information. Interesting Temechon cheers, gryff Quote Link to comment Share on other sites More sharing options...
gryff Posted February 27, 2016 Share Posted February 27, 2016 Here is my screen shot : I think Temechon gets the same result as you when he uses Chrome. cheers gryff Quote Link to comment Share on other sites More sharing options...
mtmckenna Posted February 27, 2016 Author Share Posted February 27, 2016 Thank you for the screenshot, gryff! I tried it out in Firefox, Chrome, and Safari on my Mac, and had saw the black triangle in each one. I guess I'll have to try it on a Windows machine to see if it's a weird cross platform issue. Quote Link to comment Share on other sites More sharing options...
gryff Posted February 28, 2016 Share Posted February 28, 2016 Maybe @jerome may have some ideas - this seems to be in his ballpark cheers, gryff Quote Link to comment Share on other sites More sharing options...
jerome Posted February 28, 2016 Share Posted February 28, 2016 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 gryff 1 Quote Link to comment Share on other sites More sharing options...
mtmckenna Posted February 28, 2016 Author Share Posted February 28, 2016 Thanks, @jerome ! My goal was to be able to draw 2D shapes using vertices. I see now that's not the main use case for the ribbon object. I'll take a look at CreateDisc to see if that is versatile enough for what I'm looking to do. Quote Link to comment Share on other sites More sharing options...
jerome Posted February 28, 2016 Share Posted February 28, 2016 maybe this will help : http://babylonjs.com/Demos/Polygon/ http://doc.babylonjs.com/classes/2.3/PolygonMeshBuilder CreateDisc allows to build regular polygons only At last, the ribbon can build any 2D shape also if you set the right paths : http://doc.babylonjs.com/tutorials/Ribbon_Tutorial Quote Link to comment Share on other sites More sharing options...
mtmckenna Posted February 29, 2016 Author Share Posted February 29, 2016 Thank you, @jerome ! I'll check it out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.