text: [{"Owner":"culeaalex","Date":"2014-10-12T12:28:09Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_For the last 2 full days I am trying to make a function to draw a custom shape mesh and I can_t_t do it. I am trying to fill it with triangles (as I understand it is done)_co_ but my math skills and logic are not good for this. Plus the function I made doesn_t_t fill it correctly and loads the browser (and RAM) very much to the point that it crushes the browser for low memory (after long time usage ~ 1 hour )._lt_/p_gt__lt_p_gt_It is driving me crazy_co_ and I saw that is on the road-map_co_ but I desperately need it for the current project I am working at_co_ this being the only thing that is stopping me to advance._lt_/p_gt__lt_p_gt_PS_dd_ I do not intent (for now) to use curved lines in the custom shapes._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"joshcamas","Date":"2014-10-12T23:33:11Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Maybe this post has something helpful_dd_ _lt_a href_eq__qt_http_dd_//www.html5gamedevs.com/topic/9732-how-to-create-a-custom-mesh-in-babylonjs/_qt__gt_http_dd_//www.html5gamedevs.com/topic/9732-how-to-create-a-custom-mesh-in-babylonjs/_lt_/a_gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2014-10-13T21:31:01Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Hi culeaalex!  Good to see you again._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Um_co_ after checking around_co_ I realized that we really don_t_t have a nice tutorial about plotting custom mesh.  Someday.  But I did the next best thing_co_ and I made a _lt_strong_gt__lt_a href_eq__qt_http_dd_//www.babylonjs.com/playground/#1UHFAP_qt_ rel_eq__qt_external nofollow_qt__gt_playground scene that does some plotting_lt_/a_gt__lt_/strong_gt_.  I didn_t_t use UVs because I don_t_t understand them_co_ but later when you become a plotting expert_co_ you can teach me/us how they work.  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_It_t_s a custom mesh_co_ that_t_s for sure.  What is it?  I don_t_t know.  It_t_s a widget.  heh_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_If you un-remark this line...    // vertexData.colors _eq_ colors_sm_   ...then click RUN_co_ it will get much more colorful._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Also keep in mind that I am no expert in lighting _t_normals_t_.  I just guess_co_ mostly.  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_But_co_ you should be able to learn quite a bit from that playground scene_co_ and don_t_t forget to use the _t_Get Zip_t_ button if you want a home copy to play with._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_By the way_co_ plotting curved mesh lines is really impossible unless you (or some math) plot vertex points along the curve.  I used a tiny bit of math in _lt_a href_eq__qt_http_dd_//urbanproductions.com/wingy/babylon/plotting/arrow_plot/arrowplot01.htm_qt_ rel_eq__qt_external nofollow_qt__gt_this demo_lt_/a_gt_. Here_t_s the pertinent code_dd_ _lt_a href_eq__qt_http_dd_//urbanproductions.com/wingy/babylon/plotting/arrow_plot/js/arrowplot01.js_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//urbanproductions.com/wingy/babylon/plotting/arrow_plot/js/arrowplot01.js_lt_/a_gt_  (might be outdated).  But notice_dd__lt_/p_gt__lt_pre class_eq__qt_ipsCode prettyprint_qt__gt_var positions _eq_ [ 0_co_ 0_co_ -headlength ]_sm_var alpha _eq_ 0_sm_for (var i_eq_0_sm_i&lt_sm_12_sm_i++) {\tpositions.push(headradius * Math.sin(alpha)_co_ headradius*Math.cos(alpha)_co_ 0)_sm_        alpha +_eq_ .525_sm_}var alpha _eq_ .2625_sm_for (var i_eq_0_sm_i&lt_sm_12_sm_i++) {\tpositions.push((shaftradius-shafttaper) * Math.sin(alpha)_co_ (shaftradius-shafttaper)*Math.cos(alpha)_co_ 0)_sm_        alpha +_eq_ .525_sm_}var alpha _eq_ 0_sm_for (var i_eq_0_sm_i&lt_sm_12_sm_i++) {\tpositions.push((shaftradius+shafttaper) * Math.sin(alpha)_co_ (shaftradius+shafttaper)*Math.cos(alpha)_co_ shaftlength)_sm_        alpha +_eq_ .525_sm_}_lt_/pre_gt__lt_p_gt_First_co_ I put the tip of the arrow into the positions array_co_ and then I used some math to create three 12-segment rings.  It_t_s not exactly a curved mesh_co_ but... yes it is.  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Pardon my bad coding and newbie ways.  I hope you can find something useful in all this.  Feel free to make modifications to that playground scene_co_ hit RUN_co_ see what happens.  If you make something cool_co_ hit the SAVE button and then tell us the new URL (gotten after pressing the SAVE button).  Be well_co_ and show/tell us what you discover.  Good luck._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"culeaalex","Date":"2014-10-14T17:27:56Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_@Wingnut_dd_ I did that. The problem is that I want the user to draw in 2D any shape and then recreate it in Babylon._lt_/p_gt__lt_p_gt_Example_dd_ _lt_a href_eq__qt_http_dd_//uwork.ro/babylon_test/test3.html_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//uwork.ro/babylon_test/test3.html_lt_/a_gt_ (u can insert the vectors and it will create a custom filled shape) _lt_/p_gt__lt_p_gt_The problem with my example_dd_ it does not always fill the shape and is (as far as I can tell very RAM intensive - don_t_t know if its babylon 1.14 beta or my function )_lt_/p_gt__lt_p_gt_The solution is to create a function that files a custom shape with triangles (what I am intending to do)_co_ but the ultimate solution eludes me..._lt_/p_gt__lt_p_gt_Three.js did it_co_ but AGAIN_co_ my math skills and logic are not that good (apparently) or my understanding of 2D and 3D geometry. It would take me days/weeks to come with the solution_co_ when someone smarter (or with more experience_co_ that could understand the way three.js did it) could do it._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2014-10-14T20:15:49Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_First of all_co_ could you share the code you already have and we will try to build on top of it _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"culeaalex","Date":"2014-10-14T20:52:54Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote data-ipsquote_eq__qt__qt_ class_eq__qt_ipsQuote_qt_ data-ipsquote-contentcommentid_eq__qt_57899_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentid_eq__qt_9786_qt_ data-ipsquote-username_eq__qt_Deltakosh_qt_ data-cite_eq__qt_Deltakosh_qt_ data-ipsquote-timestamp_eq__qt_1413317749_qt__gt__lt_div_gt__lt_div_gt__lt_p_gt_First of all_co_ could you share the code you already have and we will try to build on top of it _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_/div_gt__lt_/div_gt__lt_/blockquote_gt__lt_p_gt_Here is a working page_dd_ _lt_a href_eq__qt_http_dd_//uwork.ro/babylon_test/test3.html%C2%A0_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//uwork.ro/babylon_test/test3.html _lt_/a_gt__lt_/p_gt__lt_p_gt_But again_co_ I do not think is a good script. It is not working correctly with straight lines_co_ and not even close with curves._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_And sorry to ask this_co_ but I thought Babylon.js is developed by guys @Microsoft. This is the reason I have chosen babylon.js. Should I go to three.js? Why isn_t_t this build upon/extending three.js (that I understand allows to draw custom shapes)? As far as logic goes I find it more ok to go from custom shapes to predefined shapes that are done extending custom shape._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Hoping I haven_t_t upset anyone_co_ is it possible to have this function implemented in the next 3-4 months ( for now I need only to work with straight lines in 90* angles_co_ and I can do this easily so far)_co_ or should I try three.js (or something else)? I really hope it won_t_t have to be three.js as I really love the fact that babylon.js is made for games and has already built in functions that would help me a lot. (although I intend to my app to extend any javascript webgl engine)_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"joshcamas","Date":"2014-10-14T23:56:11Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Link doesn_t_t work.  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_sad.png_qt_ alt_eq__qt__dd_(_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/sad@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"culeaalex","Date":"2014-10-15T07:09:18Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote data-ipsquote_eq__qt__qt_ class_eq__qt_ipsQuote_qt_ data-ipsquote-contentcommentid_eq__qt_57912_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentid_eq__qt_9786_qt_ data-ipsquote-username_eq__qt_joshcamas_qt_ data-cite_eq__qt_joshcamas_qt_ data-ipsquote-timestamp_eq__qt_1413330971_qt__gt__lt_div_gt__lt_div_gt__lt_p_gt_Link doesn_t_t work.   _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_sad.png_qt_ alt_eq__qt__dd_(_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/sad@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_/div_gt__lt_/div_gt__lt_/blockquote_gt__lt_p_gt_It had a space at the end of .html_lt_/p_gt__lt_p_gt_The link is _dd_ _lt_a href_eq__qt_http_dd_//uwork.ro/babylon_test/test3.html_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//uwork.ro/babylon_test/test3.html_lt_/a_gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2014-10-16T16:43:22Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_I meant_dd_ could you use babylonjs_t_ playground? This way we can work together on it _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"culeaalex","Date":"2014-10-16T18:29:22Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_blockquote data-ipsquote_eq__qt__qt_ class_eq__qt_ipsQuote_qt_ data-ipsquote-contentcommentid_eq__qt_58075_qt_ data-ipsquote-contenttype_eq__qt_forums_qt_ data-ipsquote-contentclass_eq__qt_forums_Topic_qt_ data-ipsquote-contentid_eq__qt_9786_qt_ data-ipsquote-username_eq__qt_Deltakosh_qt_ data-cite_eq__qt_Deltakosh_qt_ data-ipsquote-timestamp_eq__qt_1413477802_qt__gt__lt_div_gt__lt_div_gt__lt_p_gt_I meant_dd_ could you use babylonjs_t_ playground? This way we can work together on it _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_/div_gt__lt_/div_gt__lt_/blockquote_gt__lt_p_gt_How? We could only work together if we could brainstorm _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ alt_eq__qt__dd_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt_ Again I say_dd_ MY FUNCTION is wrong and _qt_works_qt_ only with straight lines. I can make it in the playground in the weekend just to show u_co_ but I do not think it will help u much. This has to be thought how to approach the problem. The best way to do it is like it was done with Babylon.CSG_dd_ someone translate the functions from Three.js to Babylon.js. The problem is that I can_t_t do it. I know my limitations_co_ and it would take me too much to understand what three.js has done there (first)_co_ then translate it the best to babylon.js (example of what I wan_t_t to do in babylon_dd_ _lt_a href_eq__qt_http_dd_//threejs.org/examples/#webgl_geometry_shapes_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//threejs.org/examples/#webgl_geometry_shapes_lt_/a_gt_ ). _lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2014-10-16T19:45:47Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_I do not read three.js code just to be sure I_t_m not influenced byt it. But if someone want to port the code there is no problem (As long as you credit the source)_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]