gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Opengl charts do not fill the available space #3557

Closed lesquoyb closed 1 year ago

lesquoyb commented 1 year ago

Describe the bug Contrary to java2D charts, opengl ones do not fill the whole available space, leading to clumsy displays

To Reproduce Copy paste this model:

/**
* Name: fill
* Based on the internal empty template. 
* Author: baptiste
* Tags: 
*/

model fill

global
{
    list<float> myldata <- [];
    list<list<float>> mylldata <- [[]];
    list<list<float>> mylldata2 <- [[]];
    int xsize <- 100;
    int ysize <- 100;
    init
    {
        do update_chart();
    }

    reflex do_action
    {
        do update_chart();
    }

    action update_chart
    {
        myldata <- [];
        mylldata <- [];
        loop xi from: 0 to: xsize - 1
        {
            add cos((xi + cycle * 20) * 2) to: myldata;
            add [] to: mylldata;
            loop yi from: 0 to: ysize - 1
            {
                add cos((xi + cycle * 10)) + cos((yi + cycle * 10)) to: mylldata[xi];
            }

        }

        mylldata2 <- [];
        loop xi from: 0 to: xsize - 1
        {
            add [] to: mylldata2;
            loop yi from: 0 to: ysize - 1
            {
                add sin((xi + cycle * 10)) + sin((yi)) to: mylldata2[xi];
            }

        }

    }

}

experiment "Different heatmaps" type: gui
{
    output synchronized: true
    {
        display "3D" type: 3d axes:false
        {
            chart "3D" type: xy {               
                data "test" value: mylldata color: [# darkblue, # orange] accumulate_values: false;
            }
        }
        display "2D" type: 2d axes:false
        {
            chart "2D" type: xy {               
                data "test" value: mylldata color: [# darkblue, # orange] accumulate_values: false;
            }
        }

    }
}

Observe the rendering difference between 2d and 3d, while both display the same data

Expected behavior Both 2d and 3d charts fill the whole space available to them

Screenshots image

Desktop (please complete the following information):

AlexisDrogoul commented 1 year ago

A warning is now emitted when a 3d display is used to display only charts. I think we will not go further on this !