Giter Club home page Giter Club logo

web-app-3dmodel-viewer's Introduction

3D Model Viewer - ownCloud Web Extension

3d model viewer ui

This is an extension for ownCloud web for viewing 3D files. Currently, it can only display 3D models in .glb file format.

Feature Highlights ✨

  • Supported formats: [.glb]
  • Zoom/Rotate model
  • Fullscreen view
  • Navigate between model files

Build and Run

For building and running the app from the code base, follow these steps:

  1. Install the dependencies

    pnpm i
  2. Build the extension

    pnpm build

    For development, build with watch.

    pnpm build:w
  3. Start the extension and the web services

    docker compose up

Now, you can access the app at https://localhost:9200

Docker Image

This extension is available as docker image: sawjan/web-app-3dmodel-viewer

Run the extension container with:

docker run --rm -p3000:80 sawjan/web-app-3dmodel-viewer

3D models

The app currently only supports 3D models in .glb format. You can find models on the following platforms:

web-app-3dmodel-viewer's People

Contributors

saw-jan avatar koebel avatar kulmann avatar

Stargazers

 avatar  avatar Artur Neumann avatar

Watchers

 avatar

web-app-3dmodel-viewer's Issues

[feature] support of additional data formats

Would be nice if the extension would support more commonly used 3D file formats like OBJ, FBX, STL

User Story

As a user
I want to open my 3D objects (of various file format types like .obj, .fbx and .stl) in the app
so that I can preview the files.

Acceptance Criteria

  • Preview 3D objects of file formats .obj, .fbx, .stl

[feature] changing UI to dark mode

It would also be nice to enable changing the UI to dark mode. For some object the visibility might be better on dark background and also depending on lighting situation, it might be more convenient to have dark background.

User Story

As a user
I want to change the UI to dark mode
so that I can see my object better

Acceptance Criteria

  • changing of UI to dark mode should not only affect the ocis web UI elements but also the background colour and control elements of this extension

some minor UI and usability improvements

I suggest to style the control bar in the same way like in ocis web (web app preview)

  • position slightly above bottom of screen
  • with of the component should depend on amount of functions, with only 3 functions I think you can make it narrower (.oc-width-medium instead of .oc-width-large)
  • show tooltips also in full screen view would improve usability
  • and while the animation on load of object is really nice, it's a bit confusing that reset puts the object at another angle that the position that it initially is displayed after loading animation... I think the user would expect that reset puts it back at that initial position.

[feature] keyboard input

From a usability perspective, it would be nice if the extension would support keyboard input. I think some of the most common keyboard commands for 3D object manipulation are

  • WASD are most commonly used in computer games for moving one's avatar
  • also game engines like Unity 3D use WASD to move the camera left/right/forward/backward and Q and E keys to move it up and down
  • +/- as well as arrow keys are also often used for changing zoom and moving objects

User Story

As a user
I want to manipulate the position and scale factor of my 3D object using the keyboard
so that I can preview the files without using mouse input.

Acceptance Criteria

  • support of keyboard input

[bug] position of model in full scree mode

When switching between fullscreen mode and standard mode, I would expect that the model stays in the center of the viewport. However the model stays in original position which is off center in full scree mode.

Tested on MacOS 10.14.6 with Chrome Version 116

[Feature]: enable translation of UI elements

Description

ocis web and most of the web extensions allow translation of UI elements through l10n, using a tranlations.json file and gettext for all UI elements that should be translated.

User Stories

As a user
I want to see the UI in my language
So that I understand it

Acceptance Criteria

providing the mechanisms that allow translation of all relevant UI text elements, however translating the contents into other languages is not scope of this issue.

getting 3d model viewer into the app store

Description

check if all these points mentioned by Benedikt are covered before the next release: owncloud/web#11330

I think the first two points are already done for this app :)

User Stories

As a creator of ocis web extensions
I want to my extension to be listed in the marketplace
So that users can find and install it easily

Acceptance Criteria

all points above are implemented

add E2E test coverage

add basic E2E test coverage for the app

with the current implementation status, the following scenarios could be tested:

  • preview 3D model
  • toggle between standard and fullscreen mode
  • rotate and zoom 3D model?
  • reset model after modifying display position
  • show prev/next model

TODO

  • define scenario(s) (#10)
  • set up test environment (#12)
  • write tests for all scenarios (#12)

[feature] display wireframe of 3D model

For "power users" it would also be nice to give the option to show only wireframe without texture. Not sure if the current framework supports this? Maybe there is no interest in this by the average user, I guess only by those who actually work with 3D files

User Story

As a user
I want to see the wireframe of my 3D model
so that I can check the quality of the object

Acceptance Criteria

  • display wireframe of 3D objects only (no texture) if option is activated

[feature] display attributes of 3D object

It would also be nice if it was possible to display some attributes of the model, e.g. number of triangles, original size and/or current display factor. Not sure if the current framework supports this?
In my opinion this could be a function that is only shown on demand (activated in the controls) since it might not be relevant for every user.

User Story

As a user
I want to see more information about attributes of my 3D model
so that I can check the quality of the object

Acceptance Criteria

  • display attributes of 3D objects if option is activated

error with docker compose

When I build the app according to the instructions given in the README.md I get the following error message regarding the connectivity on endpoint of 3d_viewer. However the app seems to be running correctly in the browser.

Kathrins-MacBook-Pro-2:web-app-3dmodel-viewer k2$ docker compose up
[+] Running 3/3
 ⠿ Network "web-app-3dmodel-viewer_default"  Created                       3.4s
 ⠿ Container web                             Created                       0.2s
 ⠿ Container 3d_viewer                       Crea...                       0.2s
Attaching to 3d_viewer, web
The new 'docker compose' command is currently experimental. To provide feedback or request new features please open issues at https://github.com/docker/compose-cli
Error response from daemon: driver failed programming external connectivity on endpoint 3d_viewer (9a1fd50a7480b25efff7d2a23e5161830b28e517f27bfe9fd8d8f8634e5e894a): Bind for 0.0.0.0:3000 failed: port is already allocated
Kathrins-MacBook-Pro-2:web-app-3dmodel-viewer k2$ docker ps -al
CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS    PORTS     NAMES
5e86721ed6d5   nginx:1.25.3   "/docker-entrypoint.…"   23 seconds ago   Created             3d_viewer

E2E test coverage for rotate, zoom and reset of 3D model

add E2E test coverage for rotate, zoom and reset of 3D model

  • research if it's possible to do assertions related to size and position of the model (camera angle and distance between camera and model)
  • if so, add test coverage for this

Previously, these steps had been defined in the Scenario for testing these aspects:

# rotate, zoom and reset 3D model
When the user rotates the model
And the user zooms into the model
Then the size and position of the 3D model should be changed accordingly
When the user resets the viewport
Then the 3D model should be display in the default size and position

When steps in the scenario above were previously implemented in this PR, but removed in these commits because of lacking implementation of assertion in Then steps:

[tests]: run E2E tests in multiple browsers

Since oCIS supports multiple browser option, these same set of browser options should be used for oCIS extensions.

code sample from ocis web (shared by Amrita)

  const browsers: Record<string, () => Promise<Browser>> = {
    firefox: async (): Promise<Browser> => await firefox.launch(browserConfiguration),
    webkit: async (): Promise<Browser> => await webkit.launch(browserConfiguration),
    chrome: async (): Promise<Browser> =>
      await chromium.launch({ ...browserConfiguration, channel: 'chrome' }),
    chromium: async (): Promise<Browser> => await chromium.launch(browserConfiguration)
  }

Originally posted by @amrita-shrestha in #12 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.