threejsfundamentals

 by   gfxfundamentals JavaScript Version: Current License: BSD-3-Clause

kandi X-RAY | threejsfundamentals Summary

kandi X-RAY | threejsfundamentals Summary

threejsfundamentals is a JavaScript library typically used in Productivity applications. threejsfundamentals has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

This is [a series of lessons or tutorials about three.js] This is work in progress. Feel free to contribute, especially localizations.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              threejsfundamentals has a medium active ecosystem.
              It has 1073 star(s) with 200 fork(s). There are 32 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              threejsfundamentals has no issues reported. On average issues are closed in 68 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of threejsfundamentals is current.

            kandi-Quality Quality

              threejsfundamentals has no bugs reported.

            kandi-Security Security

              threejsfundamentals has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              threejsfundamentals is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              threejsfundamentals releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            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 threejsfundamentals
            Get all kandi verified functions for this library.

            threejsfundamentals Key Features

            No Key Features are available at this moment for threejsfundamentals.

            threejsfundamentals Examples and Code Snippets

            No Code Snippets are available at this moment for threejsfundamentals.

            Community Discussions

            QUESTION

            How to add GLTF Model in THREEJS level?
            Asked 2021-Oct-04 at 10:00

            I want to create an extension that can load gltf once the method is call. I'm using the latest threejs module according to this blog. But got an error.

            Here's my code.

            ...

            ANSWER

            Answered 2021-Oct-04 at 10:00

            Regarding the glTF, you may check out this blog post and consider using the Autodesk.glTF ext instead: https://forge.autodesk.com/blog/gltf-20-support-forge-viewer

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

            QUESTION

            Three.js GLTFLoader cant load gltf files on my computer
            Asked 2021-Sep-15 at 17:28

            I am new to using three.js, JavaScript, html, and CSS and I am working on loading a 3d model. I have a program that is working when I pull a gltf file online, ex:

            ...

            ANSWER

            Answered 2021-Sep-15 at 17:28

            Web browsers cannot load files like images or models from local disk (unless you disable security restrictions). To get around this you must run a local server during development, see how to run things locally in the three.js documentation.

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

            QUESTION

            DirectioanlLight Doesn't work in Three.js
            Asked 2021-Jul-07 at 14:29

            I try to add light in Three.js but when I update display, light doesn't affect on my cilinder I literally copy pasted the source code from Three.js docs Three.js but it doesnt work,

            this is my code

            ...

            ANSWER

            Answered 2021-Jul-07 at 14:29

            I found issue in by code, I use MeshBasicMaterial(), which doesn't react light, I should use MeshPhongMaterial()

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

            QUESTION

            Replace plane in space with ThreeJS
            Asked 2021-Jun-28 at 13:25

            I want to replace a plane in ThreeJS to a specific Z value.

            I create a shapeBufferGeometry with shape which contains Vector3s containing the x y and z value.

            here is my code and what I obtain. I want the white plane to match the position of aqua lines.

            The code bellow allow me to render the scene with my plane the different points in it and the vertices around it.

            I know that I can use translate to move the plane but I don't know how to properly use it. And how can I know on which axis should a translate my geometry depending on my vector values.

            ...

            ANSWER

            Answered 2021-Jun-28 at 13:08

            No need to add the last point to close the contour.

            And your step // 5 assign points to .vertices needs the check for CCW for points via ShapeUtils. Assigning an array of Vector3 to .vertices of a buffer geometry is useless, as that type of geometry doesn't have that property, so you're working with buffer attributes. Calling of shapeGeom.computeFaceNormals(); is also useless.

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

            QUESTION

            Threejs gltfLoader make model clickable
            Asked 2021-Jun-23 at 06:51

            I am new to threejs and now trying to make this work since ....

            I am loading a GLTF with mappings (jpg) into threejs.

            I can't find a way to make the loaded model clickable.

            Can you please show, how to make this model clickable (single or double click and touch) and call a js-function ?

            this is my scene:

            threejs-model-link

            ...

            ANSWER

            Answered 2021-Jun-23 at 06:51

            You need to use a pointerevent like pointerup and then use the Raycaster like you already tried.

            This is the relevant code:

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

            QUESTION

            Three.js faces/vertices cut off but Bounding Box correct
            Asked 2021-Jun-15 at 12:48

            I'm using BufferGeometry to handle meshes with lots of vertices, faces and normals, which I supply via TypedArrays. During rendering, the Scene and its Mesh is constructed without any warnings or errors in the console. With BoxHelper I've constructed a Bounding Box around the mesh.

            Now the strangest thing happens: Although the Bounding Box is perfectly correct, the faces/vertices are cut off somewhere in the middle.

            To see what I mean, here is the comparison of two models rendered with a python script (left) and rendered with Three.js (right):

            The code I've used for this task can be found here in this pastebin. Any help is highly appreciated.

            ...

            ANSWER

            Answered 2021-Jun-15 at 12:48

            After some digging, I found my mistake. itemSize of BufferAttribute for the faces has to be 1.

            So I've changed this line

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

            QUESTION

            Cannot calculate 2D position from 3D co-ordinates
            Asked 2021-Jun-11 at 13:38

            I am selecting vertices from a point cloud using angular and three.js. I have been trying to label a selected vertex with its x,y,z information. I have been using these resources in my attempt:

            1. three.js Vector3 to 2D screen coordinate with rotated scene
            2. https://threejsfundamentals.org/threejs/lessons/threejs-align-html-elements-to-3d.html

            and I can't get either to work as described.

            My code currently is:

            ...

            ANSWER

            Answered 2021-Jun-11 at 13:38

            This is as close as I have managed to get it:

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

            QUESTION

            Computer freezes when loading .gltf model in three.js
            Asked 2021-Feb-08 at 22:55

            I am running an Ubuntu 20.10 machine and testing my site on Firefox. Using npm as package manager and parcel as a bundler. When I try to load a .gltf model in three.js, parcel does not show any errors. When I go to localhost:1234/ my laptop freezes and the canvas is blank.

            The directory structure and the file links in index.html and index.js are correct, so that's not an issue. I am also using parcel-plugin-static-files-copy to ensure the static file is available. Also, I generated the .gltf file using Blender and know that it's a valid json.

            Code: index.html

            ...

            ANSWER

            Answered 2021-Feb-08 at 22:55

            So turns out there was nothing wrong with the first index.js that I have mentioned in the question. The model was too high poly for my machine, because when I linked a low poly model the page loaded just fine.

            Working code: index.html

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

            QUESTION

            Shader for solid color for each triangle of plane geometry
            Asked 2021-Jan-28 at 16:20

            I have been learning webgl from webglfundamentals where I came across a simple shader example where you can paint triangles with solid color. Here is link to tutorial and original demo.

            I tried to create same effect in three js using plane geometry but I can't manage achieve solid color shader. When I use almost same setup in Three js, I get more like gradient effect. What am I doing wrong here? (I am noticing that my shader isn't consistent either as it renders differently on refresh) Also, is there place to learn shaders specifically for three js?

            ...

            ANSWER

            Answered 2021-Jan-28 at 16:20

            The PlaneBufferGeometry in three.js is using indexed vertices to share vertices so there are only 4 vertices and then 6 indices to use those 4 vertices to make 2 triangles. That means you can't give each triangle different solid colors because they share 2 vertices and a vertex can only have 1 color.

            Further, the code is choosing random colors for each vertex so even if you you used 6 vertices so that the 2 triangles didn't share any you still wouldn't get the result you linked to, instead you'd get this result which is further down the page on the same tutorial.

            Finally the code is only generating 3 floats per color so you need to set the number of components for the color attribute to 3 instead of 4

            If you want to repeat the webgl sample you'll need to provide your own 6 vertices.

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

            QUESTION

            Render-on-Demand Three.js multiple canvases (with class implementation)
            Asked 2021-Jan-28 at 12:35

            My case is like this: I have an asset inventory with multiple assets and I want whenever the user hovers on top of them to start the rendering with an OrbitController (I would prefer Trackball but I know that it is not possible due to a bug). The point is that the "this" variable of the class instance can not pass into the render method of the class :

            ...

            ANSWER

            Answered 2021-Jan-26 at 19:12

            You are providing this.render to the event handlers. this.render is technically a pointer to the prototype function (Main.prototype.render).

            When the handler is fired, the context will be dependent on how the origin executes the handler. In most cases, the context given to the handler will be that of the origin (or possibly even null). For example, window.addEventListener( 'resize', handler ); will fire resize events by calling the equivalent of handler.call( window, event );

            There are a couple ways to get around this.

            Arrow Functions implicit this

            Arrow functions use the this of the context in which they are defined. So if your arrow function is defined in a member function of your class, and that member function is being executed within a context of an instance of that class, then this within the body of that arrow function will reference the instance.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install threejsfundamentals

            The site is built into the out folder. now open your browser to http://localhost:8080.

            Support

            Of course bug fixes are always welcome. If you’d like to write a new article please try to always take one step at a time. Don’t do 2 or more things in a single step. Explain any new math in the simplest terms possible. Ideally with diagrams where possible. Also it’s probably best to ask to make sure someone else isn’t already working on a similar article.
            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/gfxfundamentals/threejsfundamentals.git

          • CLI

            gh repo clone gfxfundamentals/threejsfundamentals

          • sshUrl

            git@github.com:gfxfundamentals/threejsfundamentals.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

            Explore Related Topics

            Consider Popular JavaScript Libraries

            freeCodeCamp

            by freeCodeCamp

            vue

            by vuejs

            react

            by facebook

            bootstrap

            by twbs

            Try Top Libraries by gfxfundamentals

            webgl-fundamentals

            by gfxfundamentalsHTML

            webgl2-fundamentals

            by gfxfundamentalsHTML

            webgpufundamentals

            by gfxfundamentalsHTML

            webgpureport.org

            by gfxfundamentalsJavaScript

            live-editor

            by gfxfundamentalsJavaScript