本文整理汇总了C++中Mat4f::scale方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4f::scale方法的具体用法?C++ Mat4f::scale怎么用?C++ Mat4f::scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4f
的用法示例。
在下文中一共展示了Mat4f::scale方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MyWindow
MyWindow()
: nav(Vec3d(0,0,-2), 0.8)
{
lens.fovy(90); // set field of view angle
add(new StandardWindowKeyControls);
add(new NavInputControl(nav));
// create some shapes to draw
shapes.primitive(gl.TRIANGLES);
for(int j=0; j<1000; ++j){
int Nv = addCube(shapes);
Mat4f xfm;
xfm.setIdentity();
xfm.scale(rnd::uniform(2.,0.2));
xfm.translate(Vec3f(rnd::uniformS(20.), rnd::uniformS(20.), rnd::uniformS(20.)));
shapes.transform(xfm, shapes.vertices().size()-Nv);
for(int i=0; i<Nv; ++i){
float v = float(i)/Nv;
shapes.color(HSV(0.2*v, 1-v*0.5, 1));
}
}
}
示例2: main
int main(){
for(int i=0; i<800; ++i){
int Nv = rnd::prob(0.5)
? (rnd::prob(0.5) ? addCube(shapes) : addDodecahedron(shapes))
: addIcosahedron(shapes);
Mat4f xfm;
xfm.setIdentity();
xfm.scale(Vec3f(rnd::uniform(1.,0.1), rnd::uniform(1.,0.1), rnd::uniform(1.,0.1)));
xfm.translate(Vec3f(rnd::uniformS(8.), rnd::uniformS(8.), rnd::uniformS(8.)));
//xfm.rotate(rnd::uniform(), rnd::uniform(), rnd::uniform());
shapes.transform(xfm, shapes.vertices().size()-Nv);
for(int i=0; i<Nv; ++i){
float f = float(i)/Nv;
shapes.color(HSV(f*0.1+0.2,1,1));
}
}
shapes.primitive(Graphics::TRIANGLES);
shapes.decompress();
shapes.generateNormals();
win1.add(new StandardWindowKeyControls);
win1.create(Window::Dim(800, 600));
MainLoop::start();
return 0;
}
示例3: render
void PointHandleHighlightFigure::render(Vbo& vbo, RenderContext& context) {
float factor = context.camera().distanceTo(m_position) * m_scalingFactor;
Mat4f billboardMatrix = context.camera().billboardMatrix();
Mat4f matrix = Mat4f::Identity;
matrix.translate(m_position);
matrix *= billboardMatrix;
matrix.scale(Vec3f(factor, factor, 0.0f));
ApplyMatrix applyBillboard(context.transformation(), matrix);
ActivateShader shader(context.shaderManager(), Shaders::HandleShader);
shader.currentShader().setUniformVariable("Color", m_color);
CircleFigure circle(Axis::AZ, 0.0f, 2.0f * Math::Pi, 2.0f * m_radius, 16, false);
circle.render(vbo, context);
}
示例4: scale
void ModelTransformation::scale(const Vec3f &scaling, GLdouble dt)
{
Mat4f* val = (Mat4f*)modelMat_->clientDataPtr();
val->scale(scaling);
modelMat_->nextStamp();
}