GithubHelp home page GithubHelp logo

Speed up drawing about projection HOT 3 OPEN

aaronjenson avatar aaronjenson commented on September 21, 2024
Speed up drawing

from projection.

Comments (3)

aaronjenson avatar aaronjenson commented on September 21, 2024

Plan of attack:
Point object should have function to calculate 2d coords that saves the result. This function will accept the rotation list and the raphael paper (though it is only used for the width and height) as a parameter.
Point will retain its draw and drawConnections functions, though drawConnections will draw all connections, not just one.

Cube object calls function to calculate 2d coords, then calls draw on each point.

Strike that, just going to do it and comment the idea of the approach that works later.

from projection.

aaronjenson avatar aaronjenson commented on September 21, 2024

Attempted to speed up by rewriting Cube class, speed improvements were minimal, if any. The slowest parts of the site are:

  1. drawing connections between points. I've already significantly optimized this with #9, so making this faster will take a lot of thought.
  2. constant updates to UI elements corresponding to rotations. I tried lazy loading the elements behind the dropdown for each rotation, but that either didn't work or did not help. Maybe some other method can keep these elements from being updated unless the dropdown is open. If not, maybe add a performance mode as opposed to precision mode, hiding these elements while animating higher dimensional cubes.
    The specific elements that are slowest are the sliders for angle and velocity of each rotation, and to a lesser extent, the angle indicator on the header of each expansion panel.

from projection.

aaronjenson avatar aaronjenson commented on September 21, 2024

Next plan:

  • dont show the UI sliders while running, just highlight the axes that are rotating
  • allow exporting a rendered video, or add buffering
  • allow changing the fps

from projection.

Related Issues (20)

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.