Skip to content

Add orientation and scale attributes - #1792

Merged
elalish merged 10 commits into
masterfrom
transformModel
Jan 11, 2021
Merged

elalish merged 10 commits into
masterfrom
transformModel

Conversation

@elalish

@elalish elalish commented Dec 30, 2020

Copy link
Copy Markdown
Contributor

Fixes #426
Fixes #1118
Fixes #1724

This adds an orientation attribute specified as Euler angles and a 3-element scale attribute.

@elalish elalish self-assigned this Dec 30, 2020
@elalish
elalish merged commit f3d5f47 into master Jan 11, 2021
@elalish
elalish deleted the transformModel branch January 11, 2021 23:39
@vortice3D

vortice3D commented Sep 4, 2023 •

Copy link
Copy Markdown

Hi there, @elalish:

Any news about including the ability to update the position attributes (X, Y, Z), besides the already implemented on orientation and scale?

Best regards.

@elalish

elalish commented Sep 6, 2023

Copy link
Copy Markdown
Contributor Author

That's what camera-target is for.

@vortice3D

vortice3D commented Sep 7, 2023 •

Copy link
Copy Markdown

Good morning, @elalish:

I've tried that way (camera-target), but sadly, talking about the Y-axis (up) it seems not work, at least when passing to the AR experience. I mean that only the other two axes are kept as updated. Suppose this is the intended behaviour, being X and Z the ones defining the floor plane.

In a first moment, I supposed it could be done right off the box with a native gesture, as AR Quick Look does, touching the screen with two fingers and sliding then vertically. Wrong way!

So, is my only option to have a different model for each of the seven (7) elevations over the floor that the user can choose for the product? Clear overkill.

Another solution I've found in this issues forum, is having a specific animation for the elevation in order to choose from that the specific height is not applicable in my case, as I need to have my model animated in different ways and model-viewer doesn't support additive animations at the moment.

The other way I think I could try here is to gain access to the internal ThreeJS scenegraph, in order to manipulate the product model directly from there. I understand that the way to access the underlying ThreeJS scene is by means of:

const mw = document.querySelector("model-viewer");
const sceneSym = Object.getOwnPropertySymbols(mw).find(x => x.description === "scene");

Having then the scene pointed out in mw[sceneSym], isn't it? But how to access to my model root node frome there? Any advice on this?

Thanks for your time. Really appreciate it.

@elalish

elalish commented Sep 7, 2023

Copy link
Copy Markdown
Contributor Author

That's outside our public API, so you're welcome to hack, but you're on your own :) If you want proper support, I'd recommend helping with #4442.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rotate model on X axis Ability to position model external to glb/gltf content User-configurable transform for model when placed in AR

2 participants