Page MenuHomePhabricator

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

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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 7 2017, 12:36 AM
Ramsey-WMF triaged this task as Normal priority.Nov 7 2017, 12:38 AM

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

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:

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

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

ABorbaWMF closed this task as Resolved.Jan 12 2018, 12:42 AM

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