GithubHelp home page GithubHelp logo

arscan / hexasphere.js Goto Github PK

View Code? Open in Web Editor NEW
234.0 234.0 49.0 875 KB

🌐Generate a sphere covered (mostly) in hexagons.

Home Page: https://www.robscanlon.com/hexasphere

JavaScript 87.87% CSS 3.93% HTML 8.20%

hexasphere.js's People

Contributors

arscan avatar em3rgencylt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexasphere.js's Issues

Relation among edge length of hexagon and radius, subdivisions and tilesize?

Hello, it's a very nice work. I happend to need a program to generate hexaspere. I am not good at mathmatics. Can you help to point me the reationamong edge length of hexagon and radius, subdivisions and tilesize? That is , is there a mathmatics form like edge length = f(radius, subdivisions, tilesize)?

About visualizing music

HI, arscan.

These days, I'm making a web music player and I would like to add music visualization function using hexaphere.js.

Could I use and reference this library?

Thanks 🙂

Ordered Neighbours

Hi There. Firstly I'd like to say that this is a nifty project;

I am currently trying to build a little game which uses this library to create the game world. However I have run into an issue where I need the neighbours to be in the same order as the boundary points so that I am able to determine what tile is in a particular direction from the current tile.

Any chance that would be something you would be able to add into the library? I have tried making changes to a local copy of the library myself by using the face index as a kind of sorting key to the neighborHash but that didn't seem to work:

// tile.js
    var neighborHash = {};
    for(var f=0; f< this.faces.length; f++){
        // build boundary
        this.boundary.push(this.faces[f].getCentroid().segment(this.centerPoint, hexSize));

        // get neighboring tiles
        var otherPoints = this.faces[f].getOtherPoints(this.centerPoint);
        for(var o = 0; o < 2; o++){
            neighborHash[otherPoints[o]] = f;
        }

    }

    this.neighborIds = Object.entries(neighborHash).sort(([n1, f1], [n2, f2]) => f1 - f2).map(([n])=> n);

2-level neighbors

Hello

What's the most efficient way to find n-level neighbors?

I need to find find neighbors up to 4 levels.
image
There's a center, there are 4 level of neighbors, the further the neighbors the more their transparency.

1 level neighbors implemented by default.
What's the best way to find 2-4 level neighbors?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.