lundi 14 septembre 2020

How to create an emissive (and reflective) line or curve in THREE.js

I have a series of curves in the format:

var curve = new THREE.CatmullRomCurve3( [
    new THREE.Vector3( -10, 0, 10 ),
    new THREE.Vector3( -5, 5, 5 ),
    new THREE.Vector3( 0, 0, 0 ),
    new THREE.Vector3( 5, -5, 5 ),
    new THREE.Vector3( 10, 0, 10 )
] );
var points = curve.getPoints( 50 );
var geometry = new THREE.BufferGeometry().setFromPoints( points );
var material = new THREE.LineBasicMaterial( { color : 0xff0000 , linewidth:100} );
var curveObject = new THREE.Line( geometry, material );
scene.add(curveObject)

I want these to have a reflection visible on the surface of a shiny MeshPhong (material) Plane - preferably white. I can make the lines 'glow' using a BloomPass, however, I am more interested in producing a warped reflection on the surface.

Since LineBasicMaterial does not have an emissivity attribute in what ways can such an effect be achieved?





Aucun commentaire:

Enregistrer un commentaire