Giter Site home page Giter Site logo

flickering-alvin / threex.laser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeromeetienne/threex.laser

0.0 0.0 0.0 501 KB

three.js extension provide a laser-like display

Home Page: http://jeromeetienne.github.io/threex.laser/examples/demo.html

License: MIT License

JavaScript 89.90% Makefile 10.10%

threex.laser's Introduction

threex.laser

threex.laser is a threex game extension for three.js. It provides a laser beam effect. Excellent to add in your space game! The laser itself is fully procedural with generated texture. The bleeding effect is obtained with additive blending. threex.laser contains a more elaborate laser which dynamically collides with your scene. It is all done for you and it looks great! On impact, there is a point light and an particle sprite for cooler effects :)

Show Don't Tell

A Screenshot

screenshot

How To Install It

You can install it via script tag

<script src='threex.laserbeam.js'></script>
<script src='threex.lasercooked.js'></script>

Or you can install with bower, as you wish.

bower install threex.laser

How To Use It

threex.laserbeam.js

It is a raw laser beam using dynamic textures. Here is to create the laser beam and add it to the scene.

var laserBeam	= new THREEx.LaserBeam()
scene.add(laserBeam)

threex.lasercooked.js

It is a laser beam with dynamic collision. On impacts, to increase realism, there is sprite and point light. It depends on THREEx.LaserBeam so first create it and add it to the scene

var laserBeam	= new THREEx.LaserBeam()
scene.add(laserBeam)

Then you create the laserCooked based on it. Don't forget to update it in your render loop.

var laserCooked	= new THREEx.LaserCooked(laserBeam)
onRenderFcts.push(function(delta, now){
	// every time you render the scene, update laserCooked
	laserCooked.update(delta, now)
})

Possible Improvements

  • change in API
    • laserBeam is an actual class which export .object3d
    • .setSource(vector3)
    • .setTarget(vector3)
  • rename laser cooked in THREEx.CollidingLaser
  • make light vary random for realism
  • leave a mark on the wall
    • multimaterialobject
    • each object for a texture in a empty canvas
    • draw in this canvas and update the texture
  • laser with pointing leap

threex.laser's People

Contributors

jeromeetienne avatar

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.