• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
lizhengjin
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页
2010年9月17日
提取旋转矩阵
摘要: 非常简单.因为一个旋转矩阵不管如何旋转其x y z旋转分量的模总是1 那么只要求旋转分量的模 如果模不唯一, 那么那个摸的值就是相应scale向量分量的值. VECTOR3 scale; MATRIX33 mat;(3x3矩阵, 是4x4矩阵旋转部分) 假设行向量格式 scale.x = VECTOR3(mat(0,0) , mat(1,0), mat(2,0)).Lengt... 阅读全文
posted @ 2010-09-17 14:27 lizhengjin 阅读(761) 评论(1) 推荐(0)
2010年9月16日
osg,由eye,center,up生成的左乘,右手坐标系的矩阵
摘要: Vec3d f(center-eye); f.normalize(); Vec3d s(f^up); s.normalize(); Vec3d u(s^f); u.normalize(); set( s[0], u[0], -f[0], 0.0, s[1], u[1], -f[1], 0.0, s[2], u[2], -f[2], 0.0, 0.0, 0.0, 0.0, 1.0);//旋转分量 p... 阅读全文
posted @ 2010-09-16 23:30 lizhengjin 阅读(921) 评论(0) 推荐(0)
贝塞尔曲线递归
摘要: 下面的说明只注重对概念的表述和对实际操作过程的说明,并不进行严格的证明。 一般的贝塞尔曲线: 对给定的n+1个点,可以作出n阶的贝塞尔曲线。其中最前和最后这两个点在曲线上,其余n-1个中间点是控制点,主要用于控制曲线的形状,不一定在曲线上。 假如给定的n+1个点是(x0,y0),...,(xn,yn),以t作为参数,则生成的曲线上的所有点可以表示如下: n x=∑C(n,i)*t^i*... 阅读全文
posted @ 2010-09-16 09:50 lizhengjin 阅读(1294) 评论(2) 推荐(0)
贝赛尔曲线,四点控制
摘要: 2009年07月13日  自从上个世纪60年代,雷诺汽车公司第一次把由手工设计车体(粘土)的任务转到由计算机来完成,二维的贝塞尔曲线就成了计算机图形学中最有用的曲线之一(继直线和椭圆之后)。在PostScript中,所有曲线都用贝塞尔曲线表示--椭圆线也用贝塞尔曲线来逼近,贝塞尔曲线也用于定义PostScript字体的字符轮廓。今天的我们要感谢Pierm Bezier,是他通过一些数学的计算和推导... 阅读全文
posted @ 2010-09-16 09:37 lizhengjin 阅读(997) 评论(0) 推荐(0)
2010年8月10日
相机沿着场景旋转
摘要: class Test : public osgGA::AnimationPathManipulator{public:Test(osg::AnimationPath* path) : AnimationPathManipulator(path){}~Test(){}private:osg::Quat _rotation;osg::Vec3d _center;double _distance;dou... 阅读全文
posted @ 2010-08-10 23:35 lizhengjin 阅读(600) 评论(0) 推荐(0)
2010年7月28日
得到相交的三角面片的三个顶点坐标
摘要: class PickEvent : public osgGA::GUIEventHandler{public:PickEvent(osg::Geometry* drawable) : _drawable(drawable){}~PickEvent(){}public:bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIAction... 阅读全文
posted @ 2010-07-28 22:18 lizhengjin 阅读(602) 评论(0) 推荐(0)
2010年7月26日
使用osg::TriangleFunction仿函数求交
摘要: class PickEvent : public osgGA::GUIEventHandler{public:PickEvent(osg::Geometry* drawable) : _drawable(drawable){}~PickEvent(){}public:bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIAction... 阅读全文
posted @ 2010-07-26 22:59 lizhengjin 阅读(685) 评论(0) 推荐(0)
2010年7月18日
osg渲染到纹理的代码,把读入的节点当成纹理渲染到一个正方形上
摘要: osg::Group* group = new osg::Group;osg::Node* node = osgDB::readNodeFile("D:\\cow.osg");osg::Camera* camera = new osg::Camera;camera->setViewport(0, 0, 256, 256);osg::Image* img = new osg::Image;im... 阅读全文
posted @ 2010-07-18 22:50 lizhengjin 阅读(1902) 评论(0) 推荐(0)
2010年7月11日
osg选取
摘要: void PickHandler::pick(osgViewer::View*view, const osgGA::GUIEventAdapter&ea){ osgUtil::LineSegmentIntersector::Intersections intersections;//求集交互器 float x = ea.getX(); float y = ea.getY();//传入事件的... 阅读全文
posted @ 2010-07-11 22:38 lizhengjin 阅读(2146) 评论(1) 推荐(0)
2010年3月28日
给控件加背景色
摘要: setStyleSheet( "QToolButton{border-image:url(D://center1.png)};"); //得到进入事件,设置成深色响应鼠标移动消息,注意不要用"QToolButton:hover(border-image:ur1(D://center1.png))";去掉hover,因为本身已经在鼠标移动消息下了ui.menuBar->setStyleShee... 阅读全文
posted @ 2010-03-28 09:08 lizhengjin 阅读(400) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 19 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3