zoukankan      html  css  js  c++  java
  • osg鼠标缩放

    osg鼠标缩放

    bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) 
    {
        // 得到x的初始屏幕坐标
        float mouseX = ea.getX();
        // 得到y的初始屏幕坐标
        float mouseY = ea.getY();
        // 判断事件类型
        switch (ea.getEventType()) 
        {
        case (osgGA::GUIEventAdapter::EventType::SCROLL):
            //osgGA::GUIEventAdapter::ScrollingMotion  scrollingMotionObj=ea.getScrollingMotion();
            if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::ScrollingMotion::SCROLL_UP)
            {
                camera_scale = camera_scale + 0.1f;
            }
            if (ea.getScrollingMotion() == osgGA::GUIEventAdapter::ScrollingMotion::SCROLL_DOWN)
            {
                camera_scale = camera_scale - 0.1f;
            }
            std::cout << "camera_scale:" << camera_scale << std::endl;
            return false;
        default:
            return false;
        }
    }

    #########################

    QQ 3087438119
  • 相关阅读:
    去掉滚动条
    一些input用法
    jquery-ui datepicker
    js修改样式
    js时间
    跳转到页面的某个anchor
    事件传递
    flex对象.show()的时候display变成block
    html中传递信息
    button disable and enable
  • 原文地址:https://www.cnblogs.com/herd/p/15352116.html
Copyright © 2011-2022 走看看