Comments (3)
The model is visible and loadable in the main "kitchen sink" example in the project:
The file is very far offset center because it looks as thought it's designed for use on the surface of a globe tile set. If you'd like to center the model at the origin you'll have to center it based on the bounding boxes (see the example page).
Also see #395 for related discussions.
from 3dtilesrendererjs.
The model is visible and loadable in the main "kitchen sink" example in the project:
The file is very far offset center because it looks as thought it's designed for use on the surface of a globe tile set. If you'd like to center the model at the origin you'll have to center it based on the bounding boxes (see [the example page](https://github.com/NASA-AMMOS/3DTilesRendererJS/blob/1ce1070f38dfa3dc0e87f7d93343bf66924dbeab/example/index.js#L540-L551)).Also see #395 for related discussions.
Thank you for your prompt response and for pointing me towards the example page and issue #395 for guidance on centering the model.
I attempted to center the model at the origin by calculating the bounding box as suggested. However, I seem to be running into an issue extracting the correct values for the bounding box. Here's the TypeScript code snippet I used:
const box = new THREE.Box3();
const sphere = new THREE.Sphere();
// Attempt to update tiles center
if (tilesRenderer.getBoundingBox(box)) {
box.getCenter(tilesRenderer.group.position).multiplyScalar(-1);
tilesRenderer.group.position.multiplyScalar(-1);
} else if (tilesRenderer.getBoundingSphere(sphere)) {
tilesRenderer.group.position.copy(sphere.center).multiplyScalar(-1);
}
console.debug('Bounding Box:', box);
console.debug('Bounding Sphere:', sphere);
When I run this code, the console output for the bounding box and sphere does not seem to reflect the expected values.
Could you provide any insights on what might be going wrong? Is there a specific step or adjustment that I might be missing?
Any further assistance would be greatly appreciated.
Additionally, I've noticed that in Cesium, as well as with the 3D Tiles specification, the position of the tileset can be adjusted by modifying the transform attribute in the root tile node. This feature is quite useful for aligning models in non-geospatial contexts.
In my current usage of 3DTilesRendererJS, I couldn't locate a similar attribute or method that allows for such transformations. The ability to manipulate the root transform directly, or at least to clear any transforms present in the root and other tiles, would be incredibly beneficial for displaying models in a non-geographic space within Three.js.
Do you have plans to incorporate a feature in 3DTilesRendererJS that would allow for adjusting the root tile transform? Or is there an existing approach to reset or clear the transforms in the root and other tiles that I might have overlooked?
I look forward to your thoughts on this matter.
from 3dtilesrendererjs.
Could you provide any insights on what might be going wrong? Is there a specific step or adjustment that I might be missing?
Additionally, I've noticed that in Cesium, as well as with the 3D Tiles specification, the position of the tileset can be adjusted by modifying the transform attribute in the root tile node. This feature is quite useful for aligning models in non-geospatial contexts.
In my current usage of 3DTilesRendererJS, I couldn't locate a similar attribute or method that allows for such transformations.
Please read the documentation for the class members and functions you are using instead of just copying the code. The descriptions for the bounding box and bounding sphere functions should answer your question. group
is also described in the docs as the container group for the 3d tiles objects.
If you have more specific questions from the documentation I can answer those here but please take a look at the README.
from 3dtilesrendererjs.
Related Issues (20)
- Aborted tiles leave remaining ImageBitmaps HOT 2
- GlobeControls: There's a big jump in speed at zoom out transition
- Remove callback assignments in favor of event listeners
- Remove gated logic behind r165
- Loaders: Change "load" to "loadAsync" to align with three.js api
- If loading a large model, will it use web work acceleration? HOT 1
- Move loaders to "loaders" folder
- EnvironmentControls: Clicking outside the click range can cause the camera to "jump" to a far position
- there is no BatchTable attribute for PNTS HOT 1
- The issue with testing by Jest HOT 1
- Bug: DOMException: signal is aborted without reason HOT 2
- GlobeControls: Hovering over the sky and zooming in zooms the camera forward instead of to mouse position
- GoogleTilesRenderer get all needed tiles loaded status HOT 1
- Remote textures cannot be loaded HOT 1
- EnvironmentControls: Width adjustHeight = false, maxAltitude is not respected
- EnvironmentControls: When the camera is underneath a model clicking does not work
- StructuralMetadata: Clean up code
- StructuralMetadata: Validate all fields from test data
- StructuralMetadata & MeshFeatures: Add more complete demo
- Could not load b3dm version 0.0 , HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 3dtilesrendererjs.