Giter VIP home page Giter VIP logo

modelviewer3d's Introduction

ModelViewer3D

3D model viewer app for Android! Supports STL files (ASCII and binary), and has limited support for OBJ (Wavefront) and PLY (Stanford) files.

Sample models from the Stanford 3D Scanning Repository, decimated using Blender.

License

Copyright 2017+ Dmitry Brant

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

modelviewer3d's People

Contributors

dbrant avatar nocamles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modelviewer3d's Issues

how to add Material and Texture in obj file.

I noticed there are TODOs in your objModel related to vt parsing. Is this related to textures and materials in obj files? Could you share the implementation approach? Thank you verymuch

Can I user my material file for the .obj 3d model

Hi @dbrant, thanks for this library.
I could see that you have created custom params for the lighting attributes like ambient, specular and diffuse.
but is there any possibility to use our own custom .mtl for the .obj files.

I want to load the .obj files to the 3d model viewer but currently, it is showing as per the lighting we set in the Light class.
looking forward to your response.
Thanks in advance.

OOM Error

Caused by: java.lang.OutOfMemoryError: Failed to allocate a 76144771 byte allocation with 25165824 free bytes and 36MB until OOM, max allowed footprint 255490976, growth limit 268435456
When I load 100MB STL file ,it throw this error. How to solve this question?

Is it possible to load more than one Obj file at same time in a SurfaceView?

Is it possible to load more than one Obj file at same time in a SurfaceView?

Sure, right now the model is stored as a global field in ModelViewerApplication.java. You can change this to be a List of models, and then render all of them in ModelRenderer.onDrawFrame().

Originally posted by @dbrant in #7 (comment)

I still not complete this, and also I tried with your updated source for my above question, but it's not working for me, So Could you share code to load more than one object file in the same surface view?

How draw the PLY model with rgb alpha property?

Hi Brant,
As I saw in the code to read the PLY object, you only read the x,y,z properties.

property float x
property float y
property float z

The model will be displayed in the gray color mode.
How to draw the PLY model with rgb colors when the file headers contains rgb elements?

property float nx
property float ny
property float nz
property uchar red
property uchar green
property uchar blue
property uchar alpha

Thank you very much.
Regards,
KieuThang

Is it possible to get part name of 3D Object?

Ques 1:
I have to added Human 3D object file using your excellent Renderer code,and the 3D object have multiple body parts(Head,Leg,etc..).So,Using OnTouch event can i have selected 3D model part name??

Ques 2:
Is it possible to load more than one Obj file at same time in a SurfaceView??

Thanks in Advance

How can I speed up the viewer?

hello. Thanks to your help last time, I am currently developing a function using the library.

The device we are using is the Galaxy Tab S7, but there is a phenomenon where the speed is very slow when using the viewer because it has only 4 gigabytes of memory.

Is there any way to improve the speed?
Or can you tell me how I can clear the matrix lines in the viewer?

Thank you for always.

how can load string decode base64file STL

How I can load string decode stl file ("RDovVXNlcnMvdXNlci9EZXNrdG9wL2dvIGhvYSAyMG1iLnN0bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD3EwYAI/9/v8EdkLsl7S07O6A9wd9tr0HzVv8/f589wRGUskEUvi1A+8Y9wSKyvEGT05Y/AIAb+X+/QsZOvGlL6js7oD3B322vQfNW/z/RYT3B26mqQRrAREB/nz3BEZSyQRS+LUAAgP/6f7/Ty8S7dvcwPDugPcHfba9B81b/P9paPcFwXKZBX7A7QNFhPcHbqapBGsBEQACAAO1/vx6Llrye4348f589wRGUskEUvi1AGm89wcM7tEGG+W1Ad549w...) ?

ply file is not displayed on the screen.

test_ply.zip

hello.
I tried to open a ply file using the good library you made, but the ply file I have is not displayed on the screen.

It's a binary file, and I checked that the data was normally imported through readVerticesBinary, but it wasn't actually displayed on the screen.

could i get some help?

404 Could not find com.google.vr:sdk-base:1.130.0.

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.google.vr:sdk-base:1.130.0.
Searched in the following locations:

Some binary files contain "solid $filename" in the header of the files

Some files on thingiverse actually contains "solid $filename" in the header of the file which makes the renderer think it's a text-based files which is not the case, and makes it so that the file can't be parsed.

https://www.thingiverse.com/thing:2676324/#files
These files can't get viewed because of this error.

Snippet of the binary data:
solid measuring_mini_cube_22aa †˚Äø�Õ¯å *˝$gfãB�HåBrö�BgfãBPåBú��BgfãBPåBff�BÄø�Õ¯å *˝$gfãB/yçBPWÕAgfãBh\çB�¶ÀAgfãBh\çB=f‘AÄø�Õ¯å *˝$gfãB�mçB†èDAgfãB"EìB†èDAgfãB"EìBæ‚?AÄø�Õ¯å *˝$gfãBŸ≤îBJ�RAgfãB�mçBJ�RAgfãBh\çB!MXAÄø�Õ¯å *˝$gfãBh\çB!MXAgfãB�mçBJ�RAgfãBh\çBæ‚?AÄø�Õ¯å *˝$gfãB�mçBJ�RAgfãB�mçB†èDAgfãBh\çBæ‚?AÄø�Õ¯å *˝$gfãBh\çBæ‚?AgfãB�mçB†èDAgfãB"EìBæ‚?AÄø�Õ¯å *˝$gfãBh\çBæ‚?AgfãB"EìBæ‚?AgfãBh\çB��AÄø�Õ¯å *˝$gfãBh\çB��AgfãB"EìBæ‚?

However the file is acutally legit, because it can be openend in some other STL viewer on the play store, also Ultimaker Cura for desktop has no problems viewing the model

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.