当前位置: 首页>>代码示例>>C++>>正文


C++ Sk3DView::rotateY方法代码示例

本文整理汇总了C++中Sk3DView::rotateY方法的典型用法代码示例。如果您正苦于以下问题:C++ Sk3DView::rotateY方法的具体用法?C++ Sk3DView::rotateY怎么用?C++ Sk3DView::rotateY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sk3DView的用法示例。


在下文中一共展示了Sk3DView::rotateY方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onDrawContent

    virtual void onDrawContent(SkCanvas* canvas) {
        canvas->translate(this->width()/2, this->height()/2);

        Sk3DView    view;
        view.rotateX(fRX);
        view.rotateY(fRY);
        view.applyToCanvas(canvas);

        SkPaint paint;
        if (fShaders.count() > 0) {
            bool frontFace = view.dotWithNormal(0, 0, SK_Scalar1) < 0;
            if (frontFace != fFrontFace) {
                fFrontFace = frontFace;
                fShaderIndex = (fShaderIndex + 1) % fShaders.count();
            }

            paint.setAntiAlias(true);
            paint.setShader(fShaders[fShaderIndex]);
            paint.setFilterLevel(SkPaint::kLow_FilterLevel);
            SkRect r = { -150, -150, 150, 150 };
            canvas->drawRoundRect(r, 30, 30, paint);
        }

        fRY += SampleCode::GetAnimSecondsDelta() * 90;
        if (fRY >= SkIntToScalar(360)) {
            fRY = 0;
        }
        this->inval(NULL);
    }
开发者ID:UIKit0,项目名称:skia,代码行数:29,代码来源:SampleCamera.cpp

示例2: Camera_rotate

static void Camera_rotate(JNIEnv* env, jobject obj, jfloat x, jfloat y, jfloat z) {
    jlong viewHandle = env->GetLongField(obj, gNativeInstanceFieldID);
    Sk3DView* v = reinterpret_cast<Sk3DView*>(viewHandle);
    v->rotateX(x);
    v->rotateY(y);
    v->rotateZ(z);
}
开发者ID:cuijinquan,项目名称:platform_frameworks_base,代码行数:7,代码来源:Camera.cpp

示例3: onDraw

    virtual void onDraw(SkCanvas* canvas)
    {
        this->drawBG(canvas);

        canvas->translate(this->width()/2, this->height()/2);

        Sk3DView    view;
        view.rotateX(SkIntToScalar(fRX));
        view.rotateY(SkIntToScalar(fRY));
        view.applyToCanvas(canvas);
        
        SkPaint paint;
        SkScalar rad = SkIntToScalar(50);
        SkScalar dim = rad*2;

        if (view.dotWithNormal(0, 0, SK_Scalar1) < 0) {
            paint.setColor(SK_ColorRED);
        }
        
        paint.setAntiAlias(true);

#if 0
        SkEmbossMaskFilter::Light light;
        light.fDirection[0] = SK_Scalar1;
        light.fDirection[1] = SK_Scalar1;
        light.fDirection[2] = SK_Scalar1;
        light.fAmbient = 180;
        light.fSpecular = 16 * 2;
        paint.setMaskFilter(new SkEmbossMaskFilter(light, SkIntToScalar(4)));
#endif

        canvas->drawCircle(0, 0, rad, paint);
        canvas->drawCircle(-dim, -dim, rad, paint);
        canvas->drawCircle(-dim,  dim, rad, paint);
        canvas->drawCircle( dim, -dim, rad, paint);
        canvas->drawCircle( dim,  dim, rad, paint);
        
        fRY += 1;
        if (fRY >= 360)
            fRY = 0;
        this->inval(NULL);
    }
开发者ID:Androtos,项目名称:toolchain_benchmark,代码行数:42,代码来源:SampleCamera.cpp

示例4: onDraw

    virtual void onDraw(SkCanvas* canvas) {
        this->drawBG(canvas);

        canvas->translate(this->width()/2, this->height()/2);

        Sk3DView    view;
        view.rotateX(fRX);
        view.rotateY(fRY);
        view.applyToCanvas(canvas);
        
        SkPaint paint;
        SkScalar rad = SkIntToScalar(50);
        SkScalar dim = rad*2;
        if (fShaders.count() > 0) {
            bool frontFace = view.dotWithNormal(0, 0, SK_Scalar1) < 0;
            if (frontFace != fFrontFace) {
                fFrontFace = frontFace;
                fShaderIndex = (fShaderIndex + 1) % fShaders.count();
            }
        
            paint.setAntiAlias(true);
            paint.setShader(fShaders[fShaderIndex]);
#if 0
            canvas->drawCircle(0, 0, rad, paint);
            canvas->drawCircle(-dim, -dim, rad, paint);
            canvas->drawCircle(-dim,  dim, rad, paint);
            canvas->drawCircle( dim, -dim, rad, paint);
            canvas->drawCircle( dim,  dim, rad, paint);
#else
            SkRect r = { -150, -150, 150, 150 };
            canvas->drawRoundRect(r, 30, 30, paint);
#endif
        }
        
        fRY += SampleCode::GetAnimSecondsDelta() * 90;
        if (fRY >= SkIntToScalar(360)) {
            fRY = 0;
        }
        this->inval(NULL);
    }
开发者ID:achellies,项目名称:DUI_LIb,代码行数:40,代码来源:SampleCamera.cpp

示例5: onDrawContent

    virtual void onDrawContent(SkCanvas* canvas) {
        canvas->translate(this->width()/2, this->height()/2);

        Sk3DView    view;
        view.rotateX(fRX);
        view.rotateY(fRY);
        view.applyToCanvas(canvas);

        SkPaint paint;
        if (fShaders.count() > 0) {
            bool frontFace = view.dotWithNormal(0, 0, SK_Scalar1) < 0;
            if (frontFace != fFrontFace) {
                fFrontFace = frontFace;
                fShaderIndex = (fShaderIndex + 1) % fShaders.count();
            }

            paint.setAntiAlias(true);
            paint.setShader(fShaders[fShaderIndex]);
            paint.setFilterQuality(kLow_SkFilterQuality);
            SkRect r = { -150, -150, 150, 150 };
            canvas->drawRoundRect(r, 30, 30, paint);
        }
    }
开发者ID:Arternis,项目名称:skia,代码行数:23,代码来源:SampleCamera.cpp

示例6: Camera_rotateY

static void Camera_rotateY(JNIEnv* env, jobject obj, jfloat degrees) {
    jlong viewHandle = env->GetLongField(obj, gNativeInstanceFieldID);
    Sk3DView* v = reinterpret_cast<Sk3DView*>(viewHandle);
    v->rotateY(degrees);
}
开发者ID:cuijinquan,项目名称:platform_frameworks_base,代码行数:5,代码来源:Camera.cpp

示例7: Camera_rotateY

static void Camera_rotateY(JNIEnv* env, jobject obj, float degrees) {
    Sk3DView* v = (Sk3DView*)env->GetIntField(obj, gNativeInstanceFieldID);
    v->rotateY(SkFloatToScalar(degrees));
}
开发者ID:Abhishekh-TEL,项目名称:pdroid,代码行数:4,代码来源:Camera.cpp


注:本文中的Sk3DView::rotateY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。