JerryI / Mathematica-ThreeJS-graphics-engine

A parser for Wolfram Mathematica's Graphics3D functions (written in JS)
29 stars 2 forks source link

some improvements #13

Closed asukaminato0721 closed 1 year ago

asukaminato0721 commented 1 year ago
  1. add the dev page to the log.
  2. since Buffer only affects vertices and faces, I replace others with Buffer
  3. Vector4.clone().add/sub(another) is much shorter.
  4. replace some var with const

About how to implement the

I find that there is a method called computeBoundingBox and boundingBox which will give out the position information. (I added them in the code).

So in theory, if we know the initial 2 points, the final 2 points. We can calculate the matrix to rotate it. But I am not so good at calculating these things.

JerryI commented 1 year ago

So in theory, if we know the initial 2 points, the final 2 points. We can calculate the matrix to rotate it. But I am not so good at calculating these things.

I will do this ;)

JerryI commented 1 year ago

Done! I compared to the Wolfram output, it looks like it works correctly.