- 博客(12)
- 资源 (1)
- 收藏
- 关注
原创 osgEarth拾取点、线、面(借助于osgEarth::IntersectionPicker)
进行人机交互时,经常需要拾取场景中的点、线、面,而osg中提供了LineSegmentIntersector和PolytopeIntersector两种相交检测方法。LineSegmentIntersector的实现原理是利用射线与场景求交,因此只能检测射线与平面是否相交;PolytopeIntersector的实现原理是构造一个五个面的视锥体,检测在场景中与视锥体相交的物体。本文中使用osgEarth::IntersectionPicker实现点、线、面的求交。下面的代码既可以拾取单个物体
2022-04-26 20:52:40
3637
7
转载 OSG设置透明度
1.使用材质设置透明度#include <Windows.h>#include <osgViewer/Viewer>#include <osgDB/ReadFile>#include <osgViewer/ViewerEventHandlers>#include <osg/StateSet>#include <osg/ShapeDrawable>#include <osg/Material>#inclu.
2022-04-26 11:32:38
1649
原创 osgearth处理大tiff文件:利用VPB工具构建静态四叉树,使用osgearth加载成为地形层
VPB处理地形tif文件,osgearth动态加载
2022-04-13 17:11:54
1090
3
原创 osgearth3.2平面模式,加载多块本地地形
问题描述:osgearth3.2平面模式,同时加载多个具有相同srs的地形和影像文件解决思路:1.首先给map指定一个srs信息,指定一个bound信息,即要显示的范围,加载多块地形时,bound的范围为所有影像的minx,miny,maxx,maxy;2.使用map->addlayer()依次添加所有的影像层和高程层。具体实现见代码,此代码中拥有完整的实现流程。#include <osg/Notify>#include <osgGA/StateSetMani
2022-04-10 22:55:31
2275
3
原创 二叉树demo
基于链表实现的二叉树的数据结构小demo,可以实现二叉树的构建,数据的增删查改。具体功能如下:(1)创建二叉树(2)二叉树的广度优先遍历(3)前序遍历(4)中序遍历(5)后续遍历(6)插入数据(7)删除数据#pragma once#include <vector>#include<queue>using namespace std;template<class dataType>struct bNode{ dataTyp
2022-04-01 10:50:40
995
原创 C++ 11 宽窄字符转换
将宽字符串转换成窄字符串需要用到codecvt库中的std::wstring_convert。#include<string>#include <codecvt>int main(){ std::wstring str = L"中国人"; std::wstring_convert<std::codecvt<wchar_t, char, std::mbstate_t>> converter(new std::codecvt<wchar_t,
2021-09-30 13:22:19
579
原创 Osgearth设置平面投影显示
一、Osgearth中的坐标系1.地理坐标系(gcs):使用经纬、高程来表示一个位置2.投影坐标系(pcs):使用平面直角坐标系,来表示一个位置二、设置投影坐标系(代码实现)CPLSetConfigOption("GDAL_DATA", "D:\\gdal-2.3.3\\data");string wktString = "PROJCS[\"Beijing_1954_3_degree_Gauss_Kruger_CM_126E\",GEOGCS[\"GCS_Beijing 1954\",D
2021-09-25 11:20:51
2413
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人