JamesStudent Posted January 17, 2017 Share Posted January 17, 2017 Now I have other doubt, How can I dynamically do multiple spheres and how do they position themselves as a circle. Exemples below: in put 5 in the input on the html. but netx I put 8, so how i can do this ? someone can help me with this? plz Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 17, 2017 Share Posted January 17, 2017 If spheres were contained in an array: var spheres = [ ]; Any time a sphere was added or removed, I would have a function which (re-)positioned ALL of them in a loop, based on a center point, radius, the length of the array, and the index into the for loop. Quote Link to comment Share on other sites More sharing options...
JamesStudent Posted January 17, 2017 Author Share Posted January 17, 2017 31 minutes ago, JCPalmer said: If spheres were contained in an array: var spheres = [ ]; Any time a sphere was added or removed, I would have a function which (re-)positioned ALL of them in a loop, based on a center point, radius, the length of the array, and the index into the for loop. Can you make an example plz ? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 17, 2017 Share Posted January 17, 2017 Nah. I'll credit you for not trying to hide you are a student. I do not do students homework / projects for them. Others might though. Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 17, 2017 Share Posted January 17, 2017 var spheresCount = 20; var alpha = 0; for (var index = 0; index < spheresCount; index++) { var sphere = BABYLON.Mesh.CreateSphere("Sphere" + index, 32, 3, scene); sphere.position.x = 10 * Math.cos(alpha); sphere.position.z = 10 * Math.sin(alpha); alpha += (2 * Math.PI) / spheresCount; } -> http://www.babylonjs-playground.com/#2KXLF6#0 Stolen from here: http://babylonjs.com/Demos/CustomRenderTarget/ GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
JamesStudent Posted January 17, 2017 Author Share Posted January 17, 2017 1 hour ago, JCPalmer said: Nah. I'll credit you for not trying to hide you are a student. I do not do students homework / projects for them. Others might though. Ok, i understand Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 17, 2017 Share Posted January 17, 2017 I am expecting an A+ on this one though! JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 17, 2017 Share Posted January 17, 2017 Hey @JCPalmer... wouldn't you crap a log if Jim's last name was "Student"? [ link ] JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
JamesStudent Posted January 17, 2017 Author Share Posted January 17, 2017 27 minutes ago, Wingnut said: Hey @JCPalmer... wouldn't you crap a log if Jim's last name was "Student"? [ link ] xD Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 18, 2017 Share Posted January 18, 2017 18 hours ago, Wingnut said: Hey @JCPalmer... wouldn't you crap a log if Jim's last name was "Student"? [ link ] Nah, the impersonal nature of the internet is one its "features" (wing bait). I didn't have the internet when I was in university. The best advantage I could get was going to the data center building, and using the keypunch machine on the loading dock. No lines, and your print out came out really quick submitted from there. You had to type standing up, but no competition from legions of Cobol muggles from the college of business. Takes 100 cards to blow your nose in Cobol. 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.