Skip to content

Instantly share code, notes, and snippets.

View pavelvasev's full-sized avatar

Pavel Vasev pavelvasev

View GitHub Profile
// 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 ) {
// viewzavr scene generated on Fri Jan 29 2021 15:35:19 GMT+0500 (Yekaterinburg Standard Time)
var obj = vz.root;
// object obj_bgimage
var obj_bgimage = obj.vz.create_obj_by_type( { type: 'bgimage', parent: obj, name: 'bgimage' } );
obj_bgimage.setParam( 'image', "https://images.unsplash.com/photo-1518066000714-58c45f1a2c0a?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw=&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80" );
// object obj_pointes-cube
var obj_pointes_cube = obj.vz.create_obj_by_type( { type: 'pointes-cube', parent: obj, name: 'pointes-cube' } );
obj_pointes_cube.setParam( 'count', 1000 );
{
"show_axes": 1,
"extras/onoff_SaveScene": 1,
"cameraPos": [
11.701141696756515,
4.705423625544212,
124.30982374486642
],
"ay": 0,
"cameraCenter": [
---
groups:
viewpoints:
title: "Пресеты файлов"
viewpoints/alfa:
cameraPos:
- -48.58778567879536
- 46.38755179889088
import components.creative_points 1.0
Scene {
CreativePoints {
positions: fn()
radius: 2
id: pts
colors: palet.output
Scene {
id: sc
backgroundColor: [0,0,0]
Param {
id: xlen
text: "x limit "
value: 50
min: 4
a
Scene {
Triangles {
positions: {
var a=[];
for (var i=0; i<1000; i++) {
var x=Math.random(100), y=Math.random(100), z=Math.random(100);
for (var j=0; j<3*3; j++)
a.push( x+Math.random(10),y+Math.random(10),z+Math.random(10) );
}
return a;
@pavelvasev
pavelvasev / uniq.js
Created August 2, 2015 06:43
_uniqueId method for js objects
(function() {
var id_counter = 1;
Object.defineProperty(Object.prototype, "__uniqueId", {
writable: true
});
Object.defineProperty(Object.prototype, "_uniqueId", {
get: function() {
if (this.__uniqueId == undefined)
this.__uniqueId = id_counter++;
return this.__uniqueId;
Rectangle {
color: "red"
}