three.bas | THREE.JS Buffer Animation System | Graphics library

 by   zadvorsky JavaScript Version: v2.4.0 License: MIT

kandi X-RAY | three.bas Summary

kandi X-RAY | three.bas Summary

three.bas is a JavaScript library typically used in User Interface, Graphics, Unity, Three.js, WebGL applications. three.bas has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i three-bas' or download it from GitHub, npm.

THREE Buffer Animation System is an extension for THREE.js. It simplifies the workflow of extending the built-in THREE.js materials to include animation logic in the vertex shader. For an overview of this approach, check out this tutorial series. The standard way of animating objects in THREE.js is to change the values of position, rotation and scale on the CPU and upload the results to the GPU as a transformation matrix. As the number of objects increases, the volume of data sent to the GPU each frame becomes a bottleneck. THREE.BAS works around this issue by storing additional information on the GPU when the geometry is created (using attributes). The animation state is then determined in the vertex shader based on a small number of uniform values. The two building blocks of this approach are THREE.BufferGeometry and THREE.ShaderMaterial. The geometry is used to store additional attributes. The material contains animation logic inside the shader. In stead of using ShaderMaterial directly, THREE.BAS provides subclasses that duplicate the behavior of THREE.js materials (MeshBasic, MeshPhong and MeshStandard) and an API to inject (animation) logic in specific locations. This way you can make full use of features such as lighting. While this approach is more cumbersome to work with, it provides a significant performance boost both on desktop and mobile. It has been used in award winning projects such as Cavalier Challenge and DS Signature Art. See examples, documentation and the wiki for more information. There is also a tutorial here that goes through the basics of vertex shaders, and the approach of BAS. Part 4 in particular focusses on using this extension.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              three.bas has a medium active ecosystem.
              It has 966 star(s) with 88 fork(s). There are 33 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 9 open issues and 28 have been closed. On average issues are closed in 212 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of three.bas is v2.4.0

            kandi-Quality Quality

              three.bas has 0 bugs and 0 code smells.

            kandi-Security Security

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

            kandi-License License

              three.bas is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              three.bas releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.
              three.bas saves you 369 person hours of effort in developing the same functionality from scratch.
              It has 880 lines of code, 0 functions and 77 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed three.bas and discovered the below as its top functions. This is intended to give you an instant insight into three.bas implemented functionality, and help decide if they suit your requirements.
            • Creates a new instance of AnimationBufferGeometry .
            • Creates a new ScrollBufferGeometry geometry .
            • Constructs a particle system .
            • Creates an AnimationSystem .
            • create and setup the shadow light
            • Initialize a new ShadowMesh geometry .
            • Renders a tween view
            • Constructs a new ThroCamera .
            • Controller for dragging and dragging .
            • Creates a THREE . Geometry for skinning
            Get all kandi verified functions for this library.

            three.bas Key Features

            No Key Features are available at this moment for three.bas.

            three.bas Examples and Code Snippets

            No Code Snippets are available at this moment for three.bas.

            Community Discussions

            QUESTION

            Get 3D Position of shadow pixels in ThreeJS
            Asked 2022-Feb-01 at 02:31

            I have the following project below created using ThreeJS. You will notice the gold object creates a shadow behind it on a sphere where I'm only rendering the backside so we can see the objects inside. I'm using a point light in the very center of the eye model to create the shadow evenly in all directions. This is the reason the shadow is curved.

            I need to know how to get the 3D coordinates (x,y,z) of each pixel of this shadow that was created. For reference here is the code that creates the shadow with a lot removed for simplicity.

            ...

            ANSWER

            Answered 2022-Feb-01 at 02:31

            You can't extract the shadow into a new geometry because this is all calculated in the GPU shaders upon rendertime, so JavaScript doesn't really have access to the shadowMap positions. However, there is a solution.

            Assuming your point light is at (0, 0, 0), and it's at the center of the sphere, you could iterate through the vertices of the gold object and project these positions onto the sphere:

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

            QUESTION

            Why is depth test not working correctly in my code?
            Asked 2020-Jul-10 at 18:30

            depthTest and depthWrite are true on both materials, I don't know what else could be wrong.

            I'm using three-bas for the mesh with tetrahedrons

            Here is codepen

            (Use mouse to rotate the camera)

            Red tetrahedrons:

            ...

            ANSWER

            Answered 2020-Jul-10 at 18:30

            Turns out the far setting of the camera caused the issue, it should be high enough

            This solves the problem:

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

            QUESTION

            castShadow and recieveShadow is not rendering in the scene
            Asked 2020-Jun-09 at 11:22

            I am learning threejs by doing some games. I am able to render all models in the scene and added few lights to and it is perfect now, but when I try to cast and recieve shadows on the plane. The shadows of the objects in scene are not rendering.

            I dont understand where I am doing wrong.

            Below is the code

            Please have a look and help me resolving the issue.

            ...

            ANSWER

            Answered 2020-Jun-09 at 11:22

            I've tested your code offline and there are multiple issue and runtime errors:

            • AmbientLight does not cast shadows. Setting castShadow will produce a runtime error.
            • You have not configured the shadow frustum for your instance of DirectionalLight correctly. Try it with this code:

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

            QUESTION

            Three.js: Page moves down when clicking on object
            Asked 2020-May-06 at 01:25

            This is my first time adding Three.js and I just want to include in a landing page of my website. I have a problem whenever I click on the area of the scene where my object is, the page moves down. What can I do to prevent this from happening? It looks like when I click on it, the page moves so the object is in the center. I tried to add overflow: hidden; in my css but that doesn't work. I am suspecting I have to change something in the javascript code.

            ...

            ANSWER

            Answered 2020-May-06 at 01:25

            Looks like OrbitControls places a mousedown event listener on the canvas and calls the canvas into focus. You'll need to remove/override that event listener to prevent the focus behavior.

            Here's a screenshot from devtools

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install three.bas

            You can install using 'npm i three-bas' 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/zadvorsky/three.bas.git

          • CLI

            gh repo clone zadvorsky/three.bas

          • sshUrl

            git@github.com:zadvorsky/three.bas.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