Tips for Verge3D devs

From Verge3D Wiki
Revision as of 07:30, 22 August 2021 by Alexander (talk | contribs)
Jump to navigationJump to search

Use the following code to create a plane with the output of the given render target:

// DONT FORGET TO REMOVE IT!
var texture = renderTarget.texture
var geometry = new v3d.PlaneBufferGeometry(3, 3);
var material = new v3d.MeshBasicMaterial();
material.map = texture;
var planeMesh = new v3d.Mesh(geometry, material);
planeMesh.position.x = 6;
v3d.apps[0].scene.add(planeMesh);