Last active
February 26, 2021 21:24
-
-
Save pavelvasev/b3fdf752c76592f506393d4cf02dbb0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is Viewzavr component/app, generated at Sat Feb 27 2021 02:23:44 GMT+0500 (Yekaterinburg Standard Time) | |
export function setup( vz ) { | |
vz.addItemType( "js-694","My js-694", function( opts ) { | |
return create( vz, opts ); | |
} ); | |
} | |
export function create( vz,opts ) { | |
var obj = vz.createObjByType( Object.assign( {},opts,{type: "js-code"}) ); | |
// ******************** code | |
// object obj | |
obj.setParam( 'code', ` var pts = vz.vis.addPoints( obj ); | |
pts.color = [1,0,1]; | |
obj.trackParam("input",function() { | |
var v = obj.getParam("input"); | |
pts.positions = v; | |
}); | |
obj.setParam("input",[0,0,0, 2,1,5, 3,4,7 ]); | |
obj.setParamOption("input","internal",true ); | |
` ); | |
// object obj | |
var obj_obj = obj.ns.getChildByName('obj'); | |
// object points | |
var obj_obj_points = obj_obj.ns.getChildByName('points'); | |
obj_obj_points.setParam( 'radius', 56 ); | |
obj_obj_points.setParam( 'color', 255 ); | |
obj_obj_points.setParam( 'opacity', 56 ); | |
obj_obj_points.setParam( 'depth-test', 1 ); | |
obj_obj_points.setParam( 'shape', 3 ); | |
// object link | |
var obj_obj_points_link = vz.create_obj_by_type( { type: 'link', parent: obj_obj_points, name: 'link' } ); | |
obj_obj_points_link.setParam( 'enabled', true ); | |
obj_obj_points_link.setParam( 'transform-code', `// enter transform code here. arg: v - input value | |
return v` ); | |
obj_obj_points_link.setParam( 'to', "/js-code/obj/points->opacity" ); | |
obj_obj_points_link.setParam( 'from', "/->r" ); | |
obj_obj_points_link.setParam( 'tied_to_parent', true ); | |
obj_obj_points_link.setParam( 'transform-enabled', true ); | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment