Possible with built-in nodes, at least in a basic way?
I imagine:
- Draw to the viewer with (for example) the mouse on the 2D plane like posted here
- Rotate the scene with a draggable camera (and/or animate rotation of a perspective camera, like here)
- Then (most importantly), draw to the current viewer 2D plane, rotate camera, keep drawing, rotate, etc.
(Pretty sure @George_Toledo pursued this concept with some super interesting 3D sculpting stuff in QC (and for other devs?) as well. I suppose this is related to some of the VR/AR tools coming down the road, too.)
@cwright made an awesome qtz called draw in space that does this, in response to this post at kineme.net. This was achieved with the following javascript:
var result = new Object();
function matrixMult(matrix, point)
{
var temp = new Array();
temp[0] = matrix[0][0] * point[0] + matrix[0][1] * point[1] + matrix[0][2] * point[2];
temp[1] = matrix[1][0] * point[0] + matrix[1][1] * point[1] + matrix[1][2] * point[2];
temp[2] = matrix[2][0] * point[0] + matrix[2][1] * point[1] + matrix[2][2] * point[2];
point[0] = temp[0];
point[1] = temp[1];
point[2] = temp[2];
}
function transformPoint(point, xTheta, yTheta, zTheta)
{
sinX = Math.sin(xTheta);
cosX = Math.cos(xTheta);
sinY = Math.sin(yTheta);
cosY = Math.cos(yTheta);
sinZ = Math.sin(zTheta);
cosZ = Math.cos(zTheta);
// todo: do the math, and get this right
//[[cosY*cosZ, cosX*-sinZ, sinY],
//[sinX*sinY*cosZ+cosX*sinZ, sinX*sinY*-sinZ+cosX*cosZ, -sinX*cosY],
//[cosX*-sinY*cosZ+sinX*sinZ, cosX*sinY*sinZ+sinX*cosZ, cosX*cosY]];
var matrix;
matrix =
[[cosZ,-sinZ,0],
[sinZ,cosZ,0],
[0,0,1]];
matrixMult(matrix, point);
matrix =
[[cosY,0,sinY],
[0,1,0],
[-sinY,0,cosY]];
matrixMult(matrix, point);
matrix =
[[1,0,0],
[0,cosX,-sinX],
[0,sinX,cosX]];
matrixMult(matrix, point);
}
function (__structure points) main (__number inputX, __number inputY, __boolean draw, __boolean reset, __number xTheta, __number yTheta, __number zTheta)
{
if(reset || result.points == undefined)
result.points = new Array;
if(draw)
{
var point = new Array;
point[0] = inputX;
point[1] = inputY;
point[2] = 0;
transformPoint(point, xTheta*Math.PI/180, yTheta*Math.PI/180, zTheta*Math.PI/180);
result.points.push(point);
}
return result;
}