本文整理汇总了C++中GLMatrix::scale方法的典型用法代码示例。如果您正苦于以下问题:C++ GLMatrix::scale方法的具体用法?C++ GLMatrix::scale怎么用?C++ GLMatrix::scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLMatrix
的用法示例。
在下文中一共展示了GLMatrix::scale方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getProgress
void
ExpandAnim::applyTransform ()
{
GLMatrix *transform = &mTransform;
float defaultXScale = 0.3f;
float forwardProgress;
float expandProgress;
const float expandPhaseEnd = 0.5f;
forwardProgress = getProgress ();
if ((1 - forwardProgress) < expandPhaseEnd)
expandProgress = (1 - forwardProgress) / expandPhaseEnd;
else
expandProgress = 1.0f;
// animation movement
transform->translate (WIN_X (mWindow) + WIN_W (mWindow) / 2.0f,
WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f,
0.0f);
transform->scale (defaultXScale + (1.0f - defaultXScale) *
expandProgress,
(1 - forwardProgress), 0.0f);
transform->translate (-(WIN_X (mWindow) + WIN_W (mWindow) / 2.0f),
-(WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f),
0.0f);
}
示例2: lastAttrib
bool
ResizeWindow::glPaint (const GLWindowPaintAttrib &attrib,
const GLMatrix &transform,
const CompRegion ®ion,
unsigned int mask)
{
bool status;
if (window == static_cast<resize::CompWindowImpl*>(rScreen->logic.w)->impl ()
&& rScreen->logic.mode == ResizeOptions::ModeStretch)
{
GLMatrix wTransform (transform);
BoxRec box;
float xOrigin, yOrigin;
float xScale, yScale;
int x, y;
if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
return false;
status = gWindow->glPaint (attrib, transform, region,
mask | PAINT_WINDOW_NO_CORE_INSTANCE_MASK);
GLWindowPaintAttrib lastAttrib (gWindow->lastPaintAttrib ());
if (window->alpha () || lastAttrib.opacity != OPAQUE)
mask |= PAINT_WINDOW_TRANSLUCENT_MASK;
rScreen->logic.getPaintRectangle (&box);
getStretchScale (&box, &xScale, &yScale);
x = window->geometry (). x ();
y = window->geometry (). y ();
xOrigin = x - window->border ().left;
yOrigin = y - window->border ().top;
wTransform.translate (xOrigin, yOrigin, 0.0f);
wTransform.scale (xScale, yScale, 1.0f);
wTransform.translate ((rScreen->logic.geometry.x - x) / xScale - xOrigin,
(rScreen->logic.geometry.y - y) / yScale - yOrigin,
0.0f);
gWindow->glDraw (wTransform, lastAttrib, region,
mask | PAINT_WINDOW_TRANSFORMED_MASK);
}
else
{
status = gWindow->glPaint (attrib, transform, region, mask);
}
return status;
}
示例3:
void MythRenderOpenGL2::PushTransformation(const UIEffects &fx, QPointF ¢er)
{
GLMatrix newtop = m_transforms.top();
if (fx.hzoom != 1.0 || fx.vzoom != 1.0 || fx.angle != 0.0)
{
newtop.translate(-center.x(), -center.y());
newtop.scale(fx.hzoom, fx.vzoom);
newtop.rotate(fx.angle);
newtop.translate(center.x(), center.y());
}
m_transforms.push(newtop);
}
示例4: pm
bool
CubeScreen::cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib,
const GLMatrix &transform,
CompOutput *output,
std::vector<GLVector> &points)
{
WRAPABLE_HND_FUNCTN_RETURN (bool, cubeCheckOrientation, sAttrib, transform, output, points)
GLMatrix sTransform = transform;
GLMatrix mvp, pm (priv->gScreen->projectionMatrix ()->getMatrix ());
GLVector pntA, pntB, pntC;
GLVector vecA, vecB, ortho;
bool rv = false;
priv->gScreen->glApplyTransform (sAttrib, output, &sTransform);
sTransform.translate (priv->mOutputXOffset, -priv->mOutputYOffset, 0.0f);
sTransform.scale (priv->mOutputXScale, priv->mOutputYScale, 1.0f);
mvp = pm * sTransform;
pntA = mvp * points[0];
if (pntA[3] < 0.0f)
rv = !rv;
pntA.homogenize ();
pntB = mvp * points[1];
if (pntB[3] < 0.0f)
rv = !rv;
pntB.homogenize ();
pntC = mvp * points[2];
pntC.homogenize ();
vecA = pntC - pntA;
vecB = pntC - pntB;
ortho = vecA ^ vecB;
if (ortho[2] > 0.0f)
rv = !rv;
return rv;
}