Closed barnabasmolnar closed 4 years ago
Hi, just a couple of things that would be relevant:
Next week I'm going to add the ability to transform each XKT moodel as we load it (that's missing for XKT), so that will allow models to be arranged side-by-side. However, those transforms will not animatable, because that means dynamically recalculating all the entity boundaries (AABBs), which won't scale up so well for massive models - making transforms fixed means less memory and CPU overhead and better scalability. So probably won't be workable to have two rotating models beside each other in the same scene, probably separate viewers will be needed, with synch events between them. But I'll think on that a little more and get back to you. BTW if the orbit point could be between the two models, loaded in the same scene, then we don't have to rotate them in individually and they can be in the same Viewer.
Also, as you know, if we load two IFC XKT/glTF models from the same source into the same Viewer, we get ID clashes because the objects get the same IFC product IDs. To deal with that, I'm thinking of adding an option to XKTLoaderPlugin#loadModel
to cause entity IDs to get prefixed with the model's ID. The MetaObjects
would still have the unprefixed product IDs, where we'd then need to strip the model ID off the entities in order to get their MetaObjects
. Entities in multiple copies of the same model would share the same MetaObjects
.
Actually I guess putting the two models into their own Viewers would allow the Camera in each viewer to zoom to the same objects, which would be impossible if they were in the same viewer.
The downside would be that the app would use twice the memory. But there might be ways to reuse the metadata structure between the two Viewers.
Hey,
Thanks for the feedback, much appreciated!
Yes, probably putting the models into separate viewers would be the cleaner solution provided the additional memory usage doesn't lead to significant performance issues.
I just added ability to scale, rotate & translate XKT and glTF models as they are loaded - see example here
Dear @xeolabs
I'd like to ask for your opinion and possibly suggest an interesting and useful enhancement to your sdk.
I've added a TL;DR at the end of this post but would appreciate if you could give it a proper read whenever it's convenient for you. 👍
In our use case, we'd like to be able to compare 2 models. Ideally, we would have an
overlap
, aside-by-side
and astacked
(=one model below another) view.The overlapping view, I suppose, is already possible as when we load 2 models into the same Scene and we don't explicitly specify their position, their zero point will be the same. Is that about right?
However, it would be a most awesome feature if we could have 2 models side-by-side and stacked on top of each other too. End-users would certainly appreciate such a feature that would let them quickly and conveniently compare 2 possibly similar models in such a fashion, I'd imagine.
Now I've already given it some thought and experimented with implementing something similar but I've hit a few roadblocks.
My initial thought was to load multiple models into the same Scene and play with their position but then how would I exactly know what exact positions/coordinates I should specify? I'd have to do some intense calculations that involve all sorts of variables (eg viewer size, model size, bounding boxes, etc) and then somehow dynamically update the models' positions on top of that, wouldn't I?
So I was wondering if another solution could be to simply mount 2 Viewers on the page. Which I reckon would be fine in and of itself, however we'd like to somehow "synchronise" the 2 Viewers in the sense that when I rotate, move, zoom, etc the camera in one Viewer, we'd like the other Viewer to mirror all these changes and be in sync. Sort of how you've already achieved (at least part of) this with the NavCube plugin. From what I understand the NavCube is in a separate canvas but is somehow in sync with the Viewer.
Or perhaps you'd suggest something entirely different, which is fine too, we're very much open to suggestions here.
So my question would be: do you think there is a convenient way to make this happen already or is this something that you would consider adding as a feature?
I apologise for this wall of text and would very much appreciate your thoughts. Cheers!
TL;DR: