Home › Forums › Programming › Three.js Examples
- This topic has 4 replies, 3 voices, and was last updated 7 years, 1 month ago by Yuri Kovelenov.
-
AuthorPosts
-
2017-11-10 at 2:37 am #341Will WelkerCustomer
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
2017-11-10 at 2:33 pm #342Yuri KovelenovStaffMost 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
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 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
2017-11-10 at 7:47 pm #344jemCustomerI 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
2017-11-11 at 5:51 am #345Will WelkerCustomerYes, 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 );
2017-11-11 at 9:35 am #353Yuri KovelenovStaffHi 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.
-
AuthorPosts
- You must be logged in to reply to this topic.