ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator Asymetric Frustum
person icon
Mathias
Guest
Quote
2010-08-09 08:18:47

It is possible to define an asymmetric camera frustum (like using
glFrustum(left, right, bottom, top, zNear, zFar);)?

I tried to use Renderer.setProjection(); but is only called internally by the engine.

Can I access / manipulate the projection matrix inside the shader by using a Cobberlicht constant such as worldviewproj?

person icon
niko
Moderator
Quote
2010-08-09 09:16:59

Hi,
this is currently not supported, but one way would be when drawing your own geometry, you could use
gl.getUniformLocation(currentGLProgram, "worldviewproj");
where you could get the GL program with
renderer.getGLProgramFromMaterialType

Also, you could still use renderer.setProjection() with your own projection after the camera has been renderered. Or if using no camera at all, maybe.

Maybe this helps.

person icon
Mathias
Guest
Quote
2010-08-10 12:49:06

Thank you for your fast reply. But I am not sure if I understand you correctly.

I like to load my scene from a CopperCube file.
From my understanding, I could set my own projection Matrix renderer.setProjection() (i.e. in onAfterDrawAll) but it is overwritten when rendering the scene for the active camera, right?
So how could I render the scene without any camera?

person icon
niko
Moderator
Quote
2010-08-11 07:59:22

Maybe the simplest way would be your own camera. Simply derive your own class from the CameraScene node and override the render() function, or modify the camera in your scene to change it's render function to be this:


MySceneNode.prototype.render = function(renderer)
{
// call base function
Camera.prototype.render.call(this, renderer);

// set your own render projection
renderer.setProjection(yourProjection);
}



Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |