Jump to content

Question about sphere positions dynamically


JamesStudent
 Share

Recommended Posts

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 ?

Link to comment
Share on other sites

    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/:D

Link to comment
Share on other sites

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:P).  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.

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