GithubHelp home page GithubHelp logo

nkihrk / canvas-eve Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 0.0 82.68 MB

CANVAS EVE is a daily-use canvas which will be helpful in various ways ; Use it as references, memos, image-preview, etc.

Home Page: https://nkihrk.github.io/CANVAS-EVE/

License: MIT License

HTML 4.62% CSS 11.05% JavaScript 84.18% GLSL 0.15%
canvas-eve canvas reference threejs load-model model-viewer image-viewer viewer movable zoomable

canvas-eve's Issues

Currently DracoLoader is not working due to the plugin path issue

src/js/three-eve.js (line 122)

Here is the current code.

dracoLoader.setDecoderPath('../three-modules/draco/');

../three-modules/draco/ is the relative path from three-eve.js, where is the module DracoLoader looking for its decoder.
However, it doesn't seem to be loaded properly inside DracoLoader().
The concole log errors show that the loader try to find draco_wasm_wrapper.js, for example, from the path of http://localhost:8080/, and failed because of the root path set to be /build. Also the compiled JS bundles are in http://localhost:8080/js/.

chrome_2019-10-12_18-10-41

Is there any way to resolve the path ?

main.scss won't seems to fix relative paths issues when importing it to another entry point

src/scss/main.scss

When importing main.scss, which is an entry point for scss files, it will be successfully converted and loaded via webpack-dev-server. However, it will be failed compiling when running $ npm run build due to failure in loading image files.

An example code for importing main.scss.

import '../scss/main.scss';

Here is an example code for the relative path.

src/scss/components/_colpick-eve.scss (line 79)

background-image: url('../../../assets/img/red_spuit.png');

When I tried rewriting all the paths from relative to absolute, which is like down below, the build is successfully finished, but web-dev-server fails to load images on the contrary.

background-image: url(`/assets/img/red_spuit.png`);

Is there any way to figure this out ?

_updateCanvasVal() currently holds some issue causing wrong calculations

src/js/oekaki-eve.js (line 802 - 816)

_updateCanvasVal(e) {
      const $canvas = this.canvas.$newCanvasId;
      const startX = this.canvas.newCanvasPos.x;
      const startY = this.canvas.newCanvasPos.y;
      const endX = e.clientX - $('#zoom').offset().left;
      const endY = e.clientY - $('#zoom').offset().top;

      const resultX = M.abs(endX - startX);
      const resultY = M.abs(endY - startY);

      $canvas.css({
        width: `${resultX * GlbEve.MOUSE_WHEEL_VAL}px`,
        height: `${resultY * GlbEve.MOUSE_WHEEL_VAL}px`
      });
},

The cause is the down-below code.

const resultX = M.abs(endX - startX);
const resultY = M.abs(endY - startY);

M is short for Math, so the resultX and resultY always return positive values, which causes wrong calculations when endX or/and endY are less than startX or/and startY.

It needs to be fixed somehow. Unless the created canvas get inverted, anything is OK

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.