Code Monkey home page Code Monkey logo

awktree's People

Contributors

kkmcgg avatar

Watchers

 avatar

awktree's Issues

Make it better

the rotate and graphics are bad!
remember ptcloud.org? do that maybe! (bablyon.js)

Node mess

Obviously I need to move all the nodes to a folder! Yuck

Change Point Rendering to Gaussian Blur in Three.js

Issue: Change Point Rendering to Gaussian Blur in Three.js

Description

Currently, the project uses a basic point rendering technique for visualizing 3D data. The goal is to enhance this by implementing Gaussian blur instead of simple points.

Proposed Changes

1. Implement Custom Shader Material

Implement a custom shader to achieve Gaussian blur. Define the shader material as follows:

var shaderMaterial = new THREE.ShaderMaterial({
  uniforms: {
    color: { value: new THREE.Color(0xffffff) },
    scale: { value: 0.1 }
  },
  vertexShader: \`
    void main() {
      vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
      gl_PointSize = scale * ( 300.0 / -mvPosition.z );
      gl_Position = projectionMatrix * mvPosition;
    }
  \`,
  fragmentShader: \`
    uniform vec3 color;
    void main() {
      float r = distance(gl_PointCoord, vec2(0.5, 0.5));
      if (r < 0.5) {
        gl_FragColor = vec4(color, 1.0 - 2.0 * r);
      } else {
        discard;
      }
    }
  \`,
  transparent: true
});

2. Update Material Definition

Replace the current material definition for the points with the custom shader material:

// var material = new THREE.PointsMaterial({ color: getRandomColor(), size: 0.1 });
var material = shaderMaterial;

3. Update Worker Message Handling

In the worker.onmessage function, update the material to use the new shader material:

var material = shaderMaterial;  // Use the shader material here

Expected Outcome

After these changes, the point cloud should be rendered with a Gaussian blur effect instead of simple points.

Additional Information

This enhancement aims to improve the visual quality of the 3D data representation.

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.