You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, March 15th 2016, 12:18am

Get html5 canvas context

Hi

I'm messing around with the Three.js pluggin and I'm trying to pull canvas context but it keeps returning null. I'm wondering if there's away to get the krpano canvas context?



Thanks

2

Tuesday, March 15th 2016, 6:05am

What I'm trying to do now is to add a new three.js scene/camera/renderer in a separate canvas/context and when I render the scene and camera it generates error THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera but when I remove embedpano() it works. Any ideas?

Source code

1
2
3
4
	 camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );  camera.position.z = 500;            scene = new THREE.Scene();                          var ctx = $('#canvas2').get(0).getContext('webgl');  renderer = new THREE.WebGLRenderer({canvas:$('#canvas2').get(0), context:ctx});
            render();
function render(){renderer.render( scene2, camera2 );
}

3

Tuesday, March 15th 2016, 7:06am

Got it to work. Problem was because I was loading in Three.js twice.