JerryI / Mathematica-ThreeJS-graphics-engine

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

add out box #16

Closed asukaminato0721 closed 3 months ago

asukaminato0721 commented 1 year ago

I am testing plot3d.

image

but the AspectRatio is strange.

image

but I think it's acceptable. :). Since the graph is correct.

but missing the box outside makes it hard to "feel the space".

Then I found this may help. https://threejs.org/docs/#api/en/helpers/BoxHelper

But where to add it is a problem, since there may have many objects in a scene.

paulmasson commented 1 year ago

@wuyudi I would suggest adding the BoxHelper outside of all objects in the scene. Here's an example from one of my libraries:

https://github.com/paulmasson/mathcell/blob/master/src/render/threejs-template.js#L63

For this to work you of course need to run through all the input objects and find minimum and maximum extents in all three directions.