I am a noob to ThreeJS and I have a question regarding best practices for handling my data in a 3D view. My data are a bunch of oil well trajectories in the subsurface of the earth. Essentially a bunch of 3D lines.
The tricky part is that the X and Y locations are offsets from a State Plane origin and the vertical numbers (‘z’) are just depths below the initial surface location. A snippet of a 3D well path is shown below. All dimensions are in feet and the differences between all 3D dimensions is the same, again in feet. The first two columns are just offset from a datum.
Are you aware that the grid helper is actually flat? So it lies in the xz plane and all vertices have a y component of 0. AFAICS, the depth values of your data are different. Isn’t that a problem? I mean it seems that your plane isn’t flat, right?
You don’t have to shift every point in your data, anyway. You could shift the containing object. If the lines are now added directly to the scene, just move them into a THREE.Group that you can add to the scene instead. The position of the group shifts everything.
Thanks Michael. Yes, I understand that the grid is 2D with y=0 for xz . That is what I want to show, a plane of Sea Level (‘MSL’) along with my data. It is standard in the oil and gas industry to show a sea-level grid to allow users to quickly reference how their data is positioned relative to MSL.
In my data that I show, it is actually the last column that ends up being ‘y’.
My question still stands: is it better to do what you propose or to keep my data in its own coordinate system and then just make the camera work in the data’s coordinate system. I am trying the latter first, but really not getting what I want. I am trying to understand how much of threejs is built around having your data centered around ‘xz’ being centered around zero (‘0’).
As I said, I am a noob here and learning a lot. Thanks again.
There is in principle nothing wrong with moving or attaching the camera. Three.js handles that quite well, except some (historical?) problems with using camera.lookAt when the camera has transformed parents/ancestors. Some tools may be tailored for zero-centering, just as some tools/shaders are tailored for y-up. But you need to be more specific on what you are not getting that you want.