Jump to content

[SOLVED] Disable aspect correction with AppProjection


photo

Recommended Posts

Hi,

 

I'm trying to take control of Port Angeles sample project from an external application (position, weather, time, projection parameters...)

I'm facing problems when it comes to projection parameters. I've managed to provide Unigine with my own projection matrix and created a custom viewport with aspect correction disabled in my AppWorldLogic files.

 

But then I need to load the AppProjection plugin in order to warp the image and there are some conflicts. I had to modify the wall.h script so that it doesn't replace my projection matrix and it works.

The only problem that I can't seem to solve is the aspect correction being enabled once again when AppProjection is loaded.

I've tried to do the same thing and create my own viewport in the wall.h script but that doesn't help.

 

Do you have any suggestion on how to deal with this ?

 

Thank you.

Link to comment

Hi!

Sorry for the late reply.

 

You can use a little trick to disable aspect correction:
1) Enable aspect correction everywhere (its enabled by default)
2) In your projection matrix you can apply inverted aspect correction as a counterweight in order to disable it:
projection.m00 * = itof(App::get()->getWidth()) / App::get()->getHeight();

 

Best regards,

Alexander

Link to comment
×
×
  • Create New...