Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with negative scaling in Scene Viewer #4888

Open
3 of 13 tasks
iostrovs opened this issue Sep 17, 2024 · 0 comments
Open
3 of 13 tasks

Issues with negative scaling in Scene Viewer #4888

iostrovs opened this issue Sep 17, 2024 · 0 comments
Labels
flag: not model-viewer Problems that are related to our project but are ultimately some other project's issue

Comments

@iostrovs
Copy link

Description

This is an issue with Scene Viewer rather than itself. We’ve noticed that several models produce an error message when trying to view them in AR, as shown below:

The following is the URL used: https://arvr.google.com/scene-viewer/1.0?&mode=ar_only&link=&file=https://storage.googleapis.com/ilan-test-bucket-2/chair_only_matrix.glb

When trying to extract more information via logcat, I get the following error:

 E native  : E0000 00:00:1726515132.441938   19907 scene_viewer.cc:1433] Failed to Load Gltf url 'https://storage.googleapis.com/ilan-test-bucket-2/chair_only_matrix.glb' reason: INTERNAL: Invalid matrix in node Instance39","matrix":[-0.00015870700138243817,-4.6545809007768216e-11,0.0005923027399419167,0,-0.0007692244557133452,-1.1321909435833923e-11,-0.00020611302046023863,0,-2.6581501271049335e-11,0.0007963597039466617,5.545903139624212e-11,0,-0.39787514476584085,0.39610362494094636,0.21921760347933594,1],"mesh":0}],"meshes":[{"primitives":[{"attributes":{"POSITION":0,"NORMAL":1},"indices":2,"material":0,"mode":4}]}],"scenes":[{"nodes":[0]}],"scene":0,"bufferViews":[{"buffer":0,"byteLength":105972,"name":"position - Instance39","byteStride":12,"byteOffset":0,"target":34962},{"buffer":0,"byteLength":105972,"byteOffset":105976,"name":"normal - Instance39","byteStride":12,"target":34962},{"buffer":0,"byteLength":202968,"byteOffset":211952,"name":"Indices - Instance39","target":34963}],"accessors":[{"name":"position - Instance39","bufferView":0,"componentType":5126,"count":8831,"type":"VEC3","min":[-354.8018493652344,-303.21978759765625,-497.3122863769531],"max":[354.8017883300781,322.6380920410156,502.5719299316406],"byteOffset":0},{"name":"normal - Instance39","bufferView":1,"componentType":5126,"count":8831,"type":"VEC3","byteOffset":0},{"name":"indices - Instance39","bufferView":2,"componentType":5125,"count":50742,"type":"SCALAR","byteOffset":0}],"materials":[{"name":"#jumplaminate Material6","doubleSided":true,"pbrMetallicRoughness":{"baseColorFactor":[1,1,1,1],"metallicFactor":0.5,"roughnessFactor":0.3},"emissiveFactor":[0,0,0],"alphaMode":"OPAQUE"}]}     ╚T♠, The matrix must be desomposable to TRS properties.

However, I get no such error message in any GLTF validator, and it displays fine in all GLTF viewers including the (see below):

I am able to decompose the single matrix in the GLTF and when manually replacing the matrix property with its corresponding RTS properties (contrary to the error in logcat), and this model does display in the Scene Viewer, but the model is still displayed incorrectly, with the chair being rendered sideways, as follows:

The following is the URL for the demo with the corresponding decomposition:
https://arvr.google.com/scene-viewer/1.0?&mode=ar_only&link=&file=https://storage.googleapis.com/ilan-test-bucket-2/chair_negative_scale.glb

If I do manipulate the scale to be strictly positive, the orientation does get corrected.

After enough investigation by manipulating the matrix to see why the decomposition allegedly fails and also why it displays incorrectly after decomposing manually, it looks like it may be related to the negative scale, but am unsure as to why.

Live Demo

See above.

Version

  • model-viewer: vX.X.X (any)

Browser Affected

  • Chrome, version: 128.0.6613.138
  • Edge
  • Firefox
  • IE
  • Safari

OS

  • Android
  • iOS
  • Linux
  • MacOS
  • Windows

AR

  • WebXR
  • SceneViewer
  • QuickLook
@elalish elalish added the flag: not model-viewer Problems that are related to our project but are ultimately some other project's issue label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: not model-viewer Problems that are related to our project but are ultimately some other project's issue
Projects
None yet
Development

No branches or pull requests

2 participants