We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Three.js Examples

Home Forums Programming Three.js Examples

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #341
    Will Welker
    Customer

    There is a vast array of three.js example code. What is the pipeline for bringing in some of this example code into a Verge3D project? Typically these examples declare a camera, scene and renderer but I assume in a Verge3D project this has already been done?
    I realize that since many of these examples are very old, some will fit, some won’t.

    In time, I suspect many of these features will be in a logic brick :yes:

    #342

    Most Three.js examples are scenes generated on the fly. This approach is very different compared to Verge3D :)
    So yes, you might want to put graphics in blend file first, than clean javascript from some scene initialization stuff and it’ll work :wacko:
    I suppose we should eventually convert these example so that they fit V3D better.

    In time, I suspect many of these features will be in a logic brick :yes:

    Yes this is our goal. In fact each logic puzzle internelly is implemented with a page or two Three.js code. I guess this is the reason designers didn’t like it B-)

    Chief 3D Verger | LinkedIn | Twitter

    #344
    jem
    Customer

    I am excited that this solution uses three.js. Three.js can procedurally generate geometry. If we imagine using Verge 3D for a sales configurator, many products that companies wish to configure would require some dynamic (parametric) geometry. A real-world application might use both static objects exported from Blender and dynamically created objects to create a complete 3D scene.

    It would be awesome if some of three.js’s geometry creation could be encapsulated within a set of bricks.

    Jeremy Wernick

    #345
    Will Welker
    Customer

    Yes, that would be cool. Maybe one logic block could take a JS file as a parameter. Then, whatever was in the JS file would load.

    // Cube
    
    				var geometry = new v3d.BoxGeometry( 200, 200, 200 );
    
    				for ( var i = 0; i < geometry.faces.length; i += 2 ) {
    
    					var hex = Math.random() * 0xffffff;
    					geometry.faces[ i ].color.setHex( hex );
    					geometry.faces[ i + 1 ].color.setHex( hex );
    
    				}
    
    				var material = new v3d.MeshBasicMaterial( { vertexColors: v3d.FaceColors, overdraw: 0.5 } );
    
    				cube = new v3d.Mesh( geometry, material );
    				cube.position.y = 150;
    				scene.add( cube );
    #353

    Hi Jem and welcome to the forums!

    I agree that procedural mesh generation is a very valuable feature of Verge3D and it opens some many new possibilities in personalization. Certainly, we should make it accessible to non-coders via JS-Puzzles callbacks or otherwise.

    @Will Interesting and timely idea! We’re thinking on how to organize JS-Puzzles interaction right now.

    Chief 3D Verger | LinkedIn | Twitter

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.