Forums > Jitter

multiple gl cameras ?

September 23, 2011 | 4:10 pm

Hi!
I couldn’t find how to get multiple cameras in a gl context since it seems like jit.gl.render is also the camera. Is there something I overlooked?
Thanks


September 24, 2011 | 8:09 am

i normally just end up with more than 1 render context and render everything a few times, including some javascript

– Pasted Max Patch, click to expand. –

javascript to be saved as dynamicRender.js:

//create a value to keep track of # of windows
var valWindows=null;
var divWindows=null;

var windowArray=new Array();
var renderArray=new Array();
var videoplaneArray=new Array();

var xyxy=new Array(4);
var ctlArray=new Array();

var nurbsArray=new Array();
var sketchArray=new Array();

var mainScreen=new Array(4);
var secondScreen=new Array(4);
var xtraScreen=0;
var windowSize=new Array(320,240);
var offsetY=50;
var border =1;

function setScreenSize(){
var tempSize = arrayfromargs(arguments);
mainScreen[0]=tempSize[0];
mainScreen[1]=tempSize[1];
mainScreen[2]=tempSize[2];
mainScreen[3]=tempSize[3];

secondScreen[0]=tempSize[4]-tempSize[0];
secondScreen[1]=tempSize[5]-tempSize[1];
secondScreen[2]=tempSize[6]-tempSize[2];
secondScreen[3]=tempSize[7]-tempSize[3];

if(secondScreen[0]==0 && secondScreen[1]==0 && secondScreen[2]==0 && secondScreen[3]==0){
xtraScreen=0;
}else{
xtraScreen=1;
}
}

function setWindowsize(x,y){
windowSize[0]=x;
windowSize[1]=y;
}

function calculateWindowsize(){

}
function setBorder(n){
var i=0;
for(i ==0; i


September 26, 2011 | 2:35 pm

Thanks llumen!
Great patch, really ingenious.



dtr
September 26, 2011 | 4:29 pm

that’s nice ‘n neat!

remark: runs well with FSAA off but all windows flicker when i have FSAA on. any idea why?


September 27, 2011 | 4:06 am

no idea about the flickering, I’ve noticed it too when on a windows machine, but not on my mac-machine.



dtr
September 28, 2011 | 12:12 am

i’m on a MBP…


October 7, 2011 | 12:33 pm

another way :

– Pasted Max Patch, click to expand. –

Viewing 7 posts - 1 through 7 (of 7 total)