Difference between revisions of "Tips for Verge3D devs"

From Verge3D Wiki
Jump to navigationJump to search
(syntax highlight)
Line 2: Line 2:
Use the following code to create a plane with the output of the given render target:
Use the following code to create a plane with the output of the given render target:


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

Revision as of 18:11, 23 August 2021

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);