Giter VIP home page Giter VIP logo

wargamevis's Introduction

代码说明:

兵棋推演可视化。

  • 使用多线程异步读取解析节点数据,解决数据解析性能卡点。
  • 实现正交摄像机和透视摄像机,使用键鼠交互浏览地图。
  • 对前后两秒数据按时间插值,实现高帧率节点平滑过渡。
main.cpp

基于opengl配置渲染流程,通过Data类获取点线数据,通过OrthoCamera类控制摄像机位置与键鼠交互。在渲染循环中,先基于图片在空间中绘制四边形地图,再根据点数据和连线数据绘制分别绘制点和线。

data_producer_multi.h

定义了点、线、点线结构体和数据解析类,数据解析类通过多线程解析不同json file的数据存储到dataMap中,dataMap满了就停止解析,当主渲染线程取走数据时,就继续解析数据。

ortho_camera.h

定义了正交摄像机,通过键鼠交互控制摄像机移动,WASD控制上下左右,鼠标滚轮控制放大缩小。

shader.h

定义了着色器类,实现着色器的编译与链接。

说明:基于opengl的渲染管线可查看opengl-cn 入门部分的内容,渲染部分的代码与该网站提供的代码基本一致,该网站有对代码的详细说明和对渲染管线的详细介绍。项目的部署运行参考opengl-cn创建窗口部分,结合上述教程和项目代码的注释很简单易懂。

wargamevis's People

Contributors

xianmei123 avatar

Stargazers

 avatar

Watchers

 avatar

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.