ObjLoader | An obj file loader for WebGL , including .mtl loder | Graphics library

 by   tiansijie JavaScript Version: 0.0.4 License: No License

kandi X-RAY | ObjLoader Summary

kandi X-RAY | ObjLoader Summary

ObjLoader is a JavaScript library typically used in User Interface, Graphics, Three.js, WebGL applications. ObjLoader has no bugs, it has no vulnerabilities and it has low support. You can install using 'npm i obj-mtl-loader' or download it from GitHub, npm.

An obj file loader for WebGL, including .mtl loder
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ObjLoader has a low active ecosystem.
              It has 31 star(s) with 14 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              ObjLoader has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of ObjLoader is 0.0.4

            kandi-Quality Quality

              ObjLoader has 0 bugs and 0 code smells.

            kandi-Security Security

              ObjLoader has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ObjLoader code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              ObjLoader does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              ObjLoader releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              ObjLoader saves you 2 person hours of effort in developing the same functionality from scratch.
              It has 8 lines of code, 0 functions and 6 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ObjLoader
            Get all kandi verified functions for this library.

            ObjLoader Key Features

            No Key Features are available at this moment for ObjLoader.

            ObjLoader Examples and Code Snippets

            No Code Snippets are available at this moment for ObjLoader.

            Community Discussions

            QUESTION

            Threejs OBJLoader'd mesh appears to have incorrect vertex ordering
            Asked 2021-Jun-09 at 02:25

            I'm using OBJLoader to load an OBJ file into my scene.

            For whatever reason the vertex ordering seems to be out of whack.

            Here is a pic of my model in blender:

            And here is a pic of my model in three:

            I've seen similar effects before with models and it's always been due to vertex ordering so I make the assumption something is going wrong there.

            EDIT By the way, notice the triangles crossing over the letters where in Blender there are none. I believe there may be an offset in the vertex count introduced somewhere.. maybe.

            The code:

            ...

            ANSWER

            Answered 2021-Jun-09 at 02:25

            By default, Three.js only renders the front face of triangles. It looks like some of your faces are inverted. Make sure you calculate normals in your 3D editor so they're pointing "outwards". That way, when you export them the engine will know which way the triangles should be facing.

            Also, Three.js doesn't render n-gons, and it looks like your letters have lots of them. Look at the 'U', it's one flat plane. Make sure you convert to triangles before exporting. Or at least convert to quads, so the exporter can easily subdivide them into tris.

            Source https://stackoverflow.com/questions/67890042

            QUESTION

            Threejs, load mtl file and textures from different urls
            Asked 2021-Jun-05 at 17:04

            So this problem might sound a little odd, let me explain. I am using the Roblox API to get the OBJ file, the MTL file and the Texture file. So the base api with the info is this https://t2.rbxcdn.com/ef63c826300347dde39b499e56bc874b and from that you get two important urls the obj file https://t4.rbxcdn.com/4844b24bb4b6696ccbafda0c79d2c406 and the mtl file https://t1.rbxcdn.com/58f8c8dfcad7ad36d17e1773a698223e, the problem is the MTL file is loaded from the subdomain t1, whereas the texture is loaded from https://t0.rbxcdn.com/21e00b04dc20ddc07659af859d4c1eaa with the subdomain t0. Now here is where it gets tricky:

            Here is the ThreeJs obj loader:

            ...

            ANSWER

            Answered 2021-Jun-05 at 17:04

            Hi so I solved this and I am going to leave this here for anyone else who needs it. THIS IS A REALLY HACKY ANSWER. So I went into the MTL loader and found,

            Source https://stackoverflow.com/questions/67850913

            QUESTION

            Uncaught ReferenceError: THREE is not defined when importing OrbitControls and OBJLoader
            Asked 2021-May-20 at 19:38

            I just removed the CDN link to threejs in my html and instead imported threejs using npm. I'm using webpack to compile everything. However, although there are no error messages when compiling, my webapp breaks and returns an error that THREE is not defined. Here are the import statements I'm using:

            ...

            ANSWER

            Answered 2021-May-20 at 19:38

            Try it with these imports:

            Source https://stackoverflow.com/questions/67626455

            QUESTION

            3D object turning black on loading the mtl file
            Asked 2021-May-17 at 13:12

            On loading the MTL file, the entire model is turning black. I have referred to this link and set the rbg parameters to 1 but that hasnt solved my issue.

            three.js mtl loader renders black

            Here is the code associated with it:

            ...

            ANSWER

            Answered 2021-May-17 at 13:12

            The MTL loads the texture as a TIFF image which can't be used as an image data source. Use JPG or PNG instead.

            Sidenote: You will notice that the object's material has a texture assigned to the map property but with an undefined image value. In such a case, the texture appears black.

            Source https://stackoverflow.com/questions/67569731

            QUESTION

            How to load texture with transparent background and make it movable?
            Asked 2021-May-11 at 02:48

            smile on shirt has black background

            smile with transparent true

            GOAL: I would like users to be able to add images/colors with buttons

            PROBLEM: but the png image texture(smiley face) loaded with textureLoader() has black background and lines crossing the image. :frowning:

            MINOR PROBLEM:

            (1) Are there any ways to match the background color of the image and the obj/gltf(shirt) that I load?

            Here are my codes.

            ...

            ANSWER

            Answered 2021-May-11 at 01:27

            You need the transparent: true setting when creating your material, like so:

            Source https://stackoverflow.com/questions/67479305

            QUESTION

            THREE.js obj not loading in vue
            Asked 2021-Mar-18 at 08:00

            I'm really confused about the way vue and THREE.js work together. I am using the exact same obj, once in a plain js environment - where it works perfectly fine - and once in vue.js, where the canvas stays empty and the dev console shows several warnings.

            The code I used in js is the exact same as in vue (see below). I also attached a screenshot of the warnings I get in the developer tool from chrome.

            I assume the problem is related to the path to the OBJ since some unexpected lines are clearly out of a HTML file. I also tried various alternatives like "./assets/threeD/harrie.obj" or using let ha = require("../assets/threeD/harrie.obj");, however the latter causes a compilation error as below:

            ...

            ANSWER

            Answered 2021-Mar-18 at 08:00

            in vue apps, your code will be compiled by webpack before running. the root of your app will usually be /dist/index.html, so the url you provided will not be a valid one, which cause the server return a html page, hence the error message in your screenshot.

            to properly point to the model, you should first import the model:

            Source https://stackoverflow.com/questions/66680497

            QUESTION

            Remove an object from scene
            Asked 2021-Mar-06 at 16:45

            my problem is that i have buttons : "view" button that enable OrbitControls , "move" button that disable OrbitControls so i can use DragControls, "cube" button that add a cube (or many cubes) to the scene and everything works fine, but when i added a "remove" button so i can remove the cube, it didnt work it says that the cube is not defined. So what should i do ? `

            ...

            ANSWER

            Answered 2021-Mar-06 at 16:44

            You have to declare your cube variable outside of createCube(). It's then in a scope that can be accessed by removeCube().

            Source https://stackoverflow.com/questions/66505845

            QUESTION

            DragControls issue
            Asked 2021-Mar-03 at 15:45

            I have a problem that when I use DragControls on an object like cubes or cylinders or spheres it works: I can drag these objects but when I use it on loaded objects with OBJLoader it doesn't work I cant drag them PS : I’m using OrbitContols also and it works fine with Geometry objects but not with loaded objects.

            ...

            ANSWER

            Answered 2021-Mar-03 at 15:44

            objects.push( object );

            The problem is that the OBJ loader does not return an instance of THREE.Mesh but THREE.Group. You have to traverse through the group and add all meshes individually to the objects array. So

            Source https://stackoverflow.com/questions/66458239

            QUESTION

            How to prevent GLFW window from showing up right in creating?
            Asked 2021-Feb-21 at 08:12

            I am creating a 3D game using LWJGL3, and I want the window loaded in the background and hidden, wait for my game setup and only than showing up. My problem is even if I call GLFW.glfwHideWindow(window) immidetly after GLFW.glfwCreateWindow(width, height, title, isFullscreen ? GLFW.glfwGetPrimaryMonitor() : 0, 0); the window flickering, than load the game and than showing up (when I want). How to prevent the window from flickering? Maybe I just change one of the arguments in GLFW.glfwCreateWindow?

            My code: Window class:

            ...

            ANSWER

            Answered 2021-Feb-21 at 08:11

            Create a hidden window. See GLFW - Window visibility. Set the GLFW_VISIBLE property before creating the window

            Source https://stackoverflow.com/questions/66299684

            QUESTION

            THREE.js fails to apply Gradient colors to Imported OBJ file
            Asked 2021-Feb-13 at 05:11

            I'm trying to load and color a sample file from the THREE.js GIT called "WaltHead.obj" located here:

            https://github.com/mrdoob/three.js/blob/dev/examples/models/obj/walt/WaltHead.obj

            I'm able to load it into my project, but when I try to paint it with gradient colors using code that has already worked 100% for me with GLTF/GLB models - it doesn't work with this ".obj" file.

            I made a fiddle to make life easier - but for some reason the model isn't loading into the fiddle file:

            https://jsfiddle.net/gilomer88/tp2hkxne/27/

            Hopefully someone can fix it so it loads?

            Either way, like I said, I'm trying to color it with gradients - but it's showing up totally black. The code is in the fiddle, and also here:

            ...

            ANSWER

            Answered 2021-Feb-13 at 05:11

            Your c.lerpColors() implementation is wrong. You're trying to pass a string into that method ("orange", "white"), which it won't recognize and return NaN.

            That method is expecting two THREE.Color objects, so you should initialize those first:

            Source https://stackoverflow.com/questions/66181007

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ObjLoader

            You can install using 'npm i obj-mtl-loader' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/tiansijie/ObjLoader.git

          • CLI

            gh repo clone tiansijie/ObjLoader

          • sshUrl

            git@github.com:tiansijie/ObjLoader.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link