Code Monkey home page Code Monkey logo

openglplotlive's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

openglplotlive's Issues

Line2D2Vecs constructor 'createAndSetupBuffers' not checking size when empty casuing crash in MSVC

createAndSetupBuffers(vertDataSizeBytes, indicesDataSizeBytes,

    /* Setup Buffers */
    updateInternalData();
    int vertDataSizeBytes = internalData.size()*sizeof(internalData[0]);
    int indicesDataSizeBytes = internalIndices.size()*sizeof(internalIndices[0]);
    createAndSetupBuffers(vertDataSizeBytes, indicesDataSizeBytes,
                          &internalData[0], &internalIndices[0],
                          2*sizeof(internalData[0]));

although it compiles and runs OK under windows using GCC compiler, the code above fails in MSVC 2019 compiled executable 'movingTimeframe.exe'

I guess it should be preallocated to contain certain size? I don't know why it runs OK when compiled with g++ toolchain under windows.

The procedure to completely build using MSVC is tedious including :

  1. git clone newest freetype
    1.1 disable the following options and rebuild with MSVC
    "-DFT_DISABLE_HARFBUZZ=ON",
    "-DFT_DISABLE_PNG=ON",
    "-DFT_DISABLE_BZIP2=ON",
    "-DFT_DISABLE_BROTLI=ON"
  2. rebuild glfw using MSVC
  3. change the LIBS file names to match the built freetype and glfw libs
  4. add 'msvc_dirent.h' from https://gitcode.net/mirrors/tronkko/dirent/-/blob/master/include/dirent.h

But without doubt, this is a terrific example of OpenGL that I'm learning from. Thank you!

Line2D2Vecs constructor 'createAndSetupBuffers' not checking size when empty casuing crash in MSVC

createAndSetupBuffers(vertDataSizeBytes, indicesDataSizeBytes,

    /* Setup Buffers */
    updateInternalData();
    int vertDataSizeBytes = (1+internalData.size())*sizeof(internalData[0]);
    int indicesDataSizeBytes = (1+internalIndices.size())*sizeof(internalIndices[0]);
    createAndSetupBuffers(vertDataSizeBytes, indicesDataSizeBytes,
                          &internalData[0], &internalIndices[0],
                          2*sizeof(internalData[0]));

although it compiles and runs OK under windows using GCC compiler, the code above fails in MSVC 2019 compiled executable 'movingTimeframe.exe'

I guess it should be preallocated to contain certain size? I don't know why it runs OK when compiled with g++ toolchain under windows.

The procedure to completely build using MSVC is tedious including :

  1. git clone newest freetype
    1.1 disable the following options and rebuild with MSVC
    "-DFT_DISABLE_HARFBUZZ=ON",
    "-DFT_DISABLE_PNG=ON",
    "-DFT_DISABLE_BZIP2=ON",
    "-DFT_DISABLE_BROTLI=ON"
  2. rebuild glfw using MSVC
  3. change the LIBS file names to match the built freetype and glfw libs
  4. add 'msvc_dirent.h' from https://gitcode.net/mirrors/tronkko/dirent/-/blob/master/include/dirent.h

But without doubt, this is a terrific example of OpenGL that I'm learning from. Thank you!

Plot Only Over The Most Recent Data

Hi,

First of all, I love this project!

My case is to run a soft real-time plot only over the most recent data (let us say 1000 time instances) and the previous portion should be dismissed. That is, the x-axis's origin tick number needs to increase once more than 1000 data points are received, yet keeping the x-axis span at 1000 time instances.

I tested the "examplePLot"(Spring Damping Live Plot) and found that the x-axis's origin is fixed at zero as more data are received.

Any ideas?
Thanks

Exception unhandled

class AxesArea
{
std::vector interactorDataX = {};
std::vector interactorDataY = {};

std::vector zoomBoxX = {};
std::vector zoomBoxY = {};
}

// Create Plot
myplot = std::make_sharedGLPL::Plot(0.0, 0.0, 1.0, 1.0, getParentDimensions(), 2, 2);
std::shared_ptrGLPL::IDrawable myPlotPt = std::dynamic_pointer_castGLPL::IDrawable(myplot);
addPlot(myPlotPt);

Crash
interactorLine = std::make_shared(&interactorDataX, &interactorDataY, newParentPointers);

Line2D2Vecs::Line2D2Vecs()
{
createAndSetupBuffers(vertDataSizeBytes, indicesDataSizeBytes, &internalData[0], &internalIndices[0],
}

because internalData[0] empty, how it works?

Scatter plot

Hi,
I would like to know if it is possibile to update dynamically a graph containing scatter plots.
For example, by using lines, this code works:

// Init GLFW
std::shared_ptr<GLPL::IWindow> window = std::shared_ptr<GLPL::IWindow>(new GLPL::Window(windowWidth, windowHeight,  false, false));
std::shared_ptr<GLPL::Window> window2 = std::dynamic_pointer_cast<GLPL::Window>(window);

std::shared_ptr<GLPL::Plot> myplot = std::make_shared<GLPL::Plot>(0.0, 0.0, 1.0, 1.0, window2->getParentDimensions(), 2, 2);
std::shared_ptr<GLPL::IDrawable> myPlotPt = std::dynamic_pointer_cast<GLPL::IDrawable>(myplot);
window2->addPlot(myPlotPt);

std::shared_ptr<GLPL::Axes2D> axesPt = std::dynamic_pointer_cast<GLPL::Axes2D>(myplot->getAxes(0));

std::shared_ptr<GLPL::ILine2D> line9s = axesPt->addLine(&xVec57, &yVec57, GLPL::SINGLE_LINE, LC_MAGENTA, 1.9, "Theor Flow");
std::shared_ptr<GLPL::Line2D2Vecs> line9sd = std::dynamic_pointer_cast<GLPL::Line2D2Vecs>(line9s);

/*float i = 0;*/
while(!glfwWindowShouldClose(window->getWindow())) {

    window2->preLoopDraw(true);


    line9sd->dataPtX->clear();
    line9sd->dataPtY->clear();

    line9sd->dataPtX->push_back(modeN);
    line9sd->dataPtY->push_back(0);
    line9sd->dataPtX->push_back(modeN);
    line9sd->dataPtY->push_back(matInput[modeN][2]);
    ....
    line9sd->updateInternalData();

    // Draw Plot
    myplot->Draw();

    // Post-loop draw
    window2->postLoopDraw();
}

First question: is this the way of proceeding correct, in order to update the vector at each step in the loop?
Second question: for scatter plot, a method 'updateInternalData' does not exist. I there way
to update a scatter plot dynamically?

Thank you
Walter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.