Skip to content

Instantly share code, notes, and snippets.

View pavelvasev's full-sized avatar

Pavel Vasev pavelvasev

View GitHub Profile
@pavelvasev
pavelvasev / test.juj
Created March 6, 2014 12:52
just a test
set a=5
@pavelvasev
pavelvasev / gist:46a9ac6d052eb5141c64
Created January 7, 2015 11:15
scenejs setIndices setPrimitive
SceneJS.Geometry.prototype.setIndices = function (data) {
if (data.indices && this._core.indexBuf) {
this._boundary = null;
var core = this._core;
core.indexBuf.bind();
core.indexBuf.setData(new Uint16Array(data.indices), data.indicesOffset || 0 );
core.arrays.indices.set(data.indices, data.indicesOffset || 0 );
this._engine.display.imageDirty = true;
}
};
@pavelvasev
pavelvasev / a.js
Created January 7, 2015 11:16
scenejs setIndices setPrimitive
SceneJS.Geometry.prototype.setIndices = function (data) {
if (data.indices && this._core.indexBuf) {
this._boundary = null;
var core = this._core;
core.indexBuf.bind();
core.indexBuf.setData(new Uint16Array(data.indices), data.indicesOffset || 0 );
core.arrays.indices.set(data.indices, data.indicesOffset || 0 );
this._engine.display.imageDirty = true;
}
};
12345
@pavelvasev
pavelvasev / apasha2.vl
Last active August 29, 2015 14:22
my test
import "https://github.com/pavelvasev/vl_triang"
Scene {
Spheres {
radius: 0.03
property var q: loadFile( Qt.resolvedUrl("d33.txt"),function(res) {
var lines = res.split("\n");
var arr = [];
for (var i=0; i<lines.length; i++) {
Scene {
text: "Подключение ThreeJS-объекта + параметры"
Param {
id: c1
text: "count 1"
value: 500
max: 10000
}
@pavelvasev
pavelvasev / b.vl
Last active August 29, 2015 14:22
Scene {
Param {
text: "rbig"
min: 1
max: 20
id: rbigParam
}
property var rbig: rbigParam.value
property var step: 15
Rectangle {
color: "red"
}
@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;
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;