osg/osgEarth为主,全面进行

 

转正了,可以考虑全面进行了。

1osg最长的一帧调试完了,所以趁热打铁,进行osg的例子,看看怎么用引擎。并且继续抄抄osg/osgEarth源码。从内到外,从外到内,内外结合进行。

osgEarth还要调试,但是在调试前,还是要把三维数字地球引擎设计精读几遍,估计恐怕到明年了。该书充斥着复杂的shader,与gpu精粹系列相关,所以还要看gpu精粹系列。GPU精粹3到几何着色器,该书也到几何着色器,我感觉并非巧合

计算机专业视频教程也要学习着。周一到周五每天不在公司的时候。

 

具体就是:

1,osg/osgEarth视频教程(周日晚上到周四)

2,osg书籍->osg例子(周一到周四晚上)

3,osg/osgearth源码抄写(周一到周五)

4,三维数字地球引擎设计每天一小节。1,2,7,15,30,60,120的多读几遍

5,windows核心编程继续进行(周一到周四)->unix环境高级编程->unix网络编程

6,opengl各视频教程(周日晚上到周四)->GPU精粹系列->hlsl高级精讲->其他shader书

7,网络编程视频教程(周日晚上到周四)

8,osgearth调试(周日晚上到周四)

9,计算机专业视频教程(周六日)

10,UE4(周六日)

11,鬼火引擎最低版本抄完

12,Ogre最低版本抄完

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
以下是一份使用OpenSceneGraph实现Bezier曲线的示例代码: ```cpp #include <osg/Geode> #include <osg/Geometry> #include <osgViewer/Viewer> osg::Vec3Array* createBezierCurve(osg::Vec3Array* points, int numSteps) { osg::Vec3Array* curvePoints = new osg::Vec3Array; for (int i = 0; i < numSteps; i++) { float t = (float)i / (float)(numSteps - 1); // Calculate blending functions float b0 = (1.0f - t) * (1.0f - t) * (1.0f - t); float b1 = 3.0f * t * (1.0f - t) * (1.0f - t); float b2 = 3.0f * t * t * (1.0f - t); float b3 = t * t * t; // Calculate point on curve osg::Vec3 p = b0 * (*points)[0] + b1 * (*points)[1] + b2 * (*points)[2] + b3 * (*points)[3]; curvePoints->push_back(p); } return curvePoints; } int main(int argc, char** argv) { // Set up points for Bezier curve osg::Vec3Array* points = new osg::Vec3Array; points->push_back(osg::Vec3(-1.0f, 0.0f, 0.0f)); points->push_back(osg::Vec3(-0.5f, 1.0f, 0.0f)); points->push_back(osg::Vec3(0.5f, -1.0f, 0.0f)); points->push_back(osg::Vec3(1.0f, 0.0f, 0.0f)); // Create geometry for curve osg::Geometry* curveGeom = new osg::Geometry; curveGeom->setVertexArray(createBezierCurve(points, 20)); // Set up color array for curve osg::Vec4Array* colors = new osg::Vec4Array; colors->push_back(osg::Vec4(1.0f, 1.0f, 0.0f, 1.0f)); curveGeom->setColorArray(colors); curveGeom->setColorBinding(osg::Geometry::BIND_OVERALL); // Create line primitive for curve curveGeom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP, 0, 20)); // Create geode for curve geometry osg::Geode* curveGeode = new osg::Geode; curveGeode->addDrawable(curveGeom); // Create viewer and add curve geode to scene osgViewer::Viewer viewer; viewer.setSceneData(curveGeode); return viewer.run(); } ``` 这个示例代码定义了一个名为createBezierCurve的函数,它接收一个osg::Vec3Array类型的点数组和一个整数,用于指定在曲线上生成多少个点。该函数返回一个osg::Vec3Array类型的数组,包含生成的曲线上的点。 主函数中,我们使用createBezierCurve函数创建了一个Bezier曲线,并将其添加到一个osg::Geometry对象中。我们还定义了一个osg::Vec4Array类型的颜色数组,用于指定曲线的颜色。最后,我们创建一个osg::Geode对象,并将曲线的osg::Geometry对象添加到其中。我们将osg::Geode对象作为场景数据传递给osgViewer::Viewer对象,这样就可以在窗口中显示曲线了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值