当前位置: 首页 > news >正文

企业网站app制作价格wordpress网站地图自动更新

企业网站app制作价格,wordpress网站地图自动更新,无锡手机网站建设公司,一个网站两个域名备案一、实现效果 二、实现原理 输入四个坐标点,第一个点为中心点,第二三四个点分别以中心点与地面垂线所在线上的各自高度水平面的交点为圆心旋转360进行圆形区域绘制,然后将三个不同高度上的圆形区域进行结合形成三维覆盖区域的轮廓面。 三、参…

一、实现效果
在这里插入图片描述
二、实现原理
输入四个坐标点,第一个点为中心点,第二三四个点分别以中心点与地面垂线所在线上的各自高度水平面的交点为圆心旋转360°进行圆形区域绘制,然后将三个不同高度上的圆形区域进行结合形成三维覆盖区域的轮廓面。
三、参考代码

void GlobeWidget::draw3dCoverageRegion(const osg::ref_ptr<osg::Vec3Array>& points)
{if (!points || points->size() < 4)return;const osg::Vec3d& centerGeo = (*points)[0];osgEarth::GeoPoint geoCenter(osgEarth::SpatialReference::get("wgs84"),centerGeo.x(), centerGeo.y(), centerGeo.z(),osgEarth::ALTMODE_ABSOLUTE);osg::Vec3d centerWorld;geoCenter.toWorld(centerWorld);osg::Vec3d axis = centerWorld;axis.normalize();// === 圆形 ===const int segments = 60;  // 保证每个圆的分段数量一致std::vector<osg::ref_ptr<osg::Vec3Array>> circles;std::vector<int> layerOffsets;int vertexOffset = 0;// 绘制每个圆for (int i = 1; i <= 3; ++i){const osg::Vec3d& ptGeo = (*points)[i];osgEarth::GeoPoint geoPt(osgEarth::SpatialReference::get("wgs84"),ptGeo.x(), ptGeo.y(), ptGeo.z(),osgEarth::ALTMODE_ABSOLUTE);osg::Vec3d ptWorld;geoPt.toWorld(ptWorld);osg::Vec3d radiusVec = ptWorld - centerWorld;osg::ref_ptr<osg::Vec3Array> circlePts = new osg::Vec3Array();// 使用相同的分段数,避免缺口for (int j = 0; j < segments; ++j){double angle = osg::DegreesToRadians(360.0 * j / segments);osg::Matrixd rot = osg::Matrixd::rotate(angle, axis);osg::Vec3d rotated = radiusVec * rot;circlePts->push_back(centerWorld + rotated);}// 绘制当前圆osg::ref_ptr<osg::Geometry> circleGeom = new osg::Geometry();circleGeom->setVertexArray(circlePts);circleGeom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINE_LOOP, 0, circlePts->size()));osg::ref_ptr<osg::Vec4Array> circleColor = new osg::Vec4Array();circleColor->push_back(osg::Vec4(0.0, 1.0, 0.0, 1.0));circleGeom->setColorArray(circleColor, osg::Array::BIND_OVERALL);osg::ref_ptr<osg::Geode> circleGeode = new osg::Geode();circleGeode->addDrawable(circleGeom);m_userDrawGroup->addChild(circleGeode);circles.push_back(circlePts);layerOffsets.push_back(vertexOffset);vertexOffset += circlePts->size();}// === 轮廓面 ===osg::ref_ptr<osg::Vec3Array> meshVerts = new osg::Vec3Array();osg::ref_ptr<osg::DrawElementsUInt> meshIndices = new osg::DrawElementsUInt(GL_TRIANGLES);// 合并所有圆的顶点for (auto& c : circles){for (auto& pt : *c)meshVerts->push_back(pt);}// 连接每一层圆之间的三角形for (size_t i = 0; i < circles.size() - 1; ++i){const int offset0 = layerOffsets[i];const int offset1 = layerOffsets[i + 1];// 确保每层圆的点数一致const int count = segments;for (int j = 0; j < count - 1; ++j){// 创建三角形meshIndices->push_back(offset0 + j);meshIndices->push_back(offset1 + j);meshIndices->push_back(offset0 + j + 1);meshIndices->push_back(offset0 + j + 1);meshIndices->push_back(offset1 + j);meshIndices->push_back(offset1 + j + 1);}// 最后一个三角形:补全圆的缺口meshIndices->push_back(offset0 + count - 1);meshIndices->push_back(offset1 + count - 1);meshIndices->push_back(offset0);meshIndices->push_back(offset0);meshIndices->push_back(offset1 + count - 1);meshIndices->push_back(offset1);}osg::ref_ptr<osg::Geometry> meshGeom = new osg::Geometry();meshGeom->setVertexArray(meshVerts);meshGeom->addPrimitiveSet(meshIndices);osg::ref_ptr<osg::Vec4Array> meshColor = new osg::Vec4Array();meshColor->push_back(osg::Vec4(1.0, 1.0, 0.0, 0.4));  // 半透明黄色meshGeom->setColorArray(meshColor, osg::Array::BIND_OVERALL);meshGeom->getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON);meshGeom->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);meshGeom->getOrCreateStateSet()->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);osg::ref_ptr<osg::Geode> meshGeode = new osg::Geode();meshGeode->addDrawable(meshGeom);m_userDrawGroup->addChild(meshGeode);// === 视角聚焦 ===if (m_osgWidget && m_osgWidget->getOsgViewer()){osgViewer::Viewer* viewer = m_osgWidget->getOsgViewer();osgEarth::Util::EarthManipulator* manip =dynamic_cast<osgEarth::Util::EarthManipulator*>(viewer->getCameraManipulator());if (manip){osgEarth::Viewpoint vp("Focus", centerGeo.x(), centerGeo.y(), centerGeo.z() + 300,0.0, -90.0, 1500.0);manip->setViewpoint(vp, 2.0);}}
}
http://www.dtcms.com/a/476602.html

相关文章:

  • 大坪网站公司如何自己创建一个网页
  • 餐饮网站建设的目的在线做网站午夜伦理
  • 郑州市精神文明建设 网站俱乐部logo免费设计在线生成
  • 什么叫seowordpress标签链接优化
  • 建设动漫网站的目的投资网站开发
  • 苏州网站建设外包wordpress 不显示分页
  • 内蒙古住房与建设厅网站网站建设用什么写
  • 南宁网站建设优化四川省住房建设厅网站打不开
  • 个人网站的设计与实现摘要m3型虚拟主机 wordpress
  • 重庆网站设计开发培训led网站建设哪家专业
  • 汕头手机建站模板宿迁市住房和城乡建设局网站
  • 成都网站建设前十WordPress里面自定义功能
  • 手机营销网站网站设计的企业
  • 北京市建设工程信息网交易网站手机网站开发工具 2018
  • 深圳网站开发报价公司注销流程及需要的材料
  • 建设银行大连市分行网站网站建设公司浙江华企
  • 旅游网页设计页面模板深圳seo搜索优化
  • h5网站开发实例教程wordpress 首页显示全文
  • 巢湖城市建设投资有限公司网站python免费下载安装
  • 建设网站对于电商的作用是?郑州模板网站建设策划公司
  • 网站如何绑定二级域名国家企业信用查询官网
  • 增城高端网站建设手机门户网站建设方案
  • 如何制作一个自己的网站光明附近网站建设公司
  • 中国建设监理协会网站个人会员系统哪个网站做视频有钱挣
  • 网站建设类广东省网站建设网站
  • 站长工具seo综合查询推广广告制作公司开票范围
  • 自己怎么做网站购买空间大连建站费用
  • 福州网站建设嘉艺seo专业学校
  • 晋州外贸网站建设衡阳seo排名
  • 自己开通一个网站需要多少钱自己做软件需要学什么