Verge3d

From QmazeWiki
Revision as of 10:20, 3 April 2019 by Nick Bannink (talk | contribs)
Jump to: navigation, search

Loading in Verge 3D

How to load in a verge 3d application into Qmaze.

If you just want to use a simple 3d scene without using puzzles, choose a Code-Based App Type in the Verge3D App Manager when creating a new project. (this is preferred)
When you are comfortable with your 3d model (made in blender), upload all the files from the application folder to the Qmaze database(files).
Use the remote desktop to upload the files as there is a possibility some (don't know which) files will get corrupt when you use the upload function in the files section of Qmaze.

When the uploading is complete, make a new report in the ReportEditor in Qmaze.
Copy all the contents in the <body> from the .html file in your application to the newly created report.
Next, copy all the contents from the .js file in your application to the report. Make sure this pasted text is in a <script> tag </script>.
IMPORTANT: make the app var global~!!!

there is a line:

var app = new v3d.App(

remove ' var '
add

var app;

one line above

window.addEventListener('load', function() {


Editing properties of a material

change color of a MeshNodeMaterial

Lookup the object:

var obj = app.scene.getObjectByName(obj);

Lookup material:

var mat = obj.material;

Set the RGB node to a color (vector4):

mat.nodeRGB[0] = new v3d.Vector4(0.1, 0.1, 0.1, 1);

Call a material update:

obj.material.needsUpdate = true;