Page MenuHomePhabricator

Change the default orientation of 3D objects in the viewer
Closed, ResolvedPublic

Assigned To
Authored By
Ramsey-WMF
Nov 7 2017, 12:36 AM
Referenced Files
F11813045: image.png
Dec 13 2017, 7:25 PM
F11813048: image.png
Dec 13 2017, 7:25 PM
F11813073: image.png
Dec 13 2017, 7:25 PM
F11813084: Screen Shot 2017-12-13 at 11.20.41 AM.png
Dec 13 2017, 7:25 PM
F11813086: Screen Shot 2017-12-13 at 11.20.27 AM.png
Dec 13 2017, 7:25 PM
F11813076: image.png
Dec 13 2017, 7:25 PM
F11048911: Screenshot 2017-11-28 13.45.09.png
Nov 28 2017, 12:53 PM
F11033873: Screen Shot 2017-11-27 at 12.52.38 PM.png
Nov 27 2017, 8:53 PM

Description

Currently 3D models in the viewer default load on their "backs". Look into changing the default "up" axis (y up may be a better default) or programmatically determine what the model's Up axis is set to and changing accordingly.

Event Timeline

Change 390274 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/3D@master] Improve camera rotation & initial position

https://gerrit.wikimedia.org/r/390274

Change 391580 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[3d2png@master] Improve camera rotation & initial position

https://gerrit.wikimedia.org/r/391580

Change 391580 merged by MarkTraceur:
[3d2png@master] Improve camera rotation & initial position

https://gerrit.wikimedia.org/r/391580

I am not sure I tested this correctly, but I am seeing the back of this 3D file I just uploaded to commons. Am I in the right place? Maybe this file is wonky?

https://commons.wikimedia.beta.wmflabs.org/wiki/File:Jebediah_free.stl

Screen Shot 2017-11-27 at 12.52.38 PM.png (1×1 px, 129 KB)

That is a problem. Seems like we've solved the "up" problem but perhaps have a "front" problem now. It's showing up on some of the other models on beta too. Is there any way we can reliably fix this, @matthiasmullie ?

Ugh - it looks like this patch didn't get merged yet (the MMV part - the 3d2png is merged, but deployment repo needs to be updated)
Apologies I hadn't noticed this one didn't get merged yet - I'll drag this ticket out of QA until it is.
Here's a screenshot of what this object looks like with the new orientation:

Screenshot 2017-11-28 13.45.09.png (1×2 px, 383 KB)

Although this orientation for this object will be better after this patch, it could still be problematic for some files.
AFAICT, the default axis orientation differs between software (and can be adjusted) and that information is not stored in the STL files.
I suspect some files may be oriented differently for other reasons than display on screens (to optimize printing) and as a result will not look good.
This patch will make the camera look at the object from an angle rather than heads-on, which should help when an object is oriented to another axis (it should at least always convey some depth, otherwise we could find ourselves staring at a blank side if it's oriented in a weird way)

Change 390274 merged by jenkins-bot:
[mediawiki/extensions/3D@master] Improve camera rotation & initial position

https://gerrit.wikimedia.org/r/390274

Alright - this is now on beta (both for MultiMediaViewer interaction with the object, as well as for thumbnails)

I tried this a bunch over the last few days and I am getting some inconsistent results (on Beta). Some 3D files are oriented well and some are not. I am not seeing this with a particular browser, it seems to happen occasionally on each one I've tried.

Original PreviewOur Preview
image.png (768×1 px, 336 KB)
image.png (768×1 px, 138 KB)
image.png (768×1 px, 321 KB)
image.png (768×1 px, 158 KB)
Screen Shot 2017-12-13 at 11.20.41 AM.png (1×2 px, 2 MB)
Screen Shot 2017-12-13 at 11.20.27 AM.png (1×2 px, 1 MB)

It looks like thingiverse does something similar to what we have right now: look at the object from an angle, rather then rendering heads-on (where you could be looking at the side if the axis are different)
But where our camera position is slightly to the right, theirs is slightly to the left (our camera standpoint is slightly higher and 90 degrees to the right, compared to thingiverse's)

AFAICT, the default axis orientation differs between software (and can be adjusted) and that information is not stored in the STL files.
I suspect some files may be oriented differently for other reasons than display on screens (to optimize printing) and as a result will not look good.

It'd be easy enough to change this and use (roughly) the same viewpoint thingiverse does (or any other 3D viewer), but there will always be objects that just don't look good.
E.g.: the example at https://phabricator.wikimedia.org/T179887#3792287, using thingiverse's rotation (90 degrees more to the left) would be looking at the object almost from the back.

While I believe that what we have right now is equivalent to thingiverse (and that we'll never get it right for all files anyway, no matter which direction we look at the object), I wouldn't mind changing it to be more in line with thingiverse.
Since there is no proper standard axis orientation, it wouldn't hurt if some viewers try to do things similarly...

Change 398460 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[3d2png@master] Look at 3D objects from another angle

https://gerrit.wikimedia.org/r/398460

Change 398461 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/3D@master] Look at 3D objects from another angle

https://gerrit.wikimedia.org/r/398461

Change 398461 merged by jenkins-bot:
[mediawiki/extensions/3D@master] Look at 3D objects from another angle

https://gerrit.wikimedia.org/r/398461

The new default orientation seems to be working as expected

Change 398460 merged by Matthias Mullie:
[3d2png@master] Look at 3D objects from another angle

https://gerrit.wikimedia.org/r/398460

Orientation is looking good when adding new files in the wizard.