Jump to content

Custom matrix projection camera


isidisi
 Share

Recommended Posts

Is posible to change the projection matrix of the camera to a custom matrix?

 

I want to do a 4 x 4 grid, where each tile is a render in order to later join them and obtain a bigger image... then I have to displace and scale after projection matrix in the camera to render each tile.

 

I tried with SetEntityMatrix but it seems not to set the projection matrix, only position and rotation of the camera...

 

Any help?

Link to comment
Share on other sites

You would have to utilize the OpenGL API to modify the GL_PROJECTION matrix.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

I tried and not works, when I do RenderWorld() Leadwerks Engine changes projection matrix with the parameters of the world's camera... is there a way to avoid this?

 

 

 

I tried adding some lines in Renderer.cpp:

float test[16]; //To check changes in projection matrix.

glMatrixMode(GL_PROJECTION);

::glLoadMatrixf(myProjectionMatrix);

::glGetFloatv(GL_PROJECTION_MATRIX, test); //Here test = myProjectionMatrix

 

// Render the scene

Wireframe( wiremode );

::glGetFloatv(GL_PROJECTION_MATRIX, test); //Here test = myProjectionMatrix

RenderWorld();

::glGetFloatv(GL_PROJECTION_MATRIX, test); //Here test != myProjectionMatrix, RenderWorld changed projection matrix before rendering :-(

Link to comment
Share on other sites

The only way would be to have the commands in the engine to get/set the camera's matrices exposed.

 

Get/Set CameraProjectionMatrix

Get/Set CameraModelViewMatrix

Get/Set CameraModelViewProjectionMatrix

 

Feature Request :rolleyes:

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...