本文整理汇总了C++中Mat4::loadScale方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4::loadScale方法的具体用法?C++ Mat4::loadScale怎么用?C++ Mat4::loadScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4
的用法示例。
在下文中一共展示了Mat4::loadScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Water::Water(Loader loader)
{
float positions[] = { -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, -1.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f };
int indices[] = { 0, 1, 3, 3, 1, 2 };
// create a ground-plane that is 2x2 meters and scale it so it becomes 100x100 meters.
waterplane = loader.createModel(positions, 12, indices, 6);
Mat4 scaleMatrix;
scaleMatrix.loadScale(150, 1, 150);
waterplane.setModelMatrix(scaleMatrix);
dudvTexture = loader.loadBMPtexture("water_dudv.bmp");
normalTexture = loader.loadBMPtexture("water_nomal.bmp");
shader.createShader("waterVertexShader.glsl", "waterFragmentShader.glsl");
reflectionFrameBuffer = FrameBufferUtilities::createBuffer();
reflectionTexture = FrameBufferUtilities::createTextureAttachment(REFLECTION_WIDTH, REFLECTION_HEIGHT);
reflectionDepthBuffer = FrameBufferUtilities::createDepthBufferAttachment(REFLECTION_WIDTH, REFLECTION_HEIGHT);
FrameBufferUtilities::unbindCurrentBuffer();
refractionFrameBuffer = FrameBufferUtilities::createBuffer();
refractionTexture = FrameBufferUtilities::createTextureAttachment(REFRACTION_WIDTH, REFRACTION_HEIGHT);
refractionDepthTexture = FrameBufferUtilities::createDepthTextureAttachment(REFRACTION_WIDTH, REFRACTION_HEIGHT);
FrameBufferUtilities::unbindCurrentBuffer();
double waterheight = 0;
reflection_clip_plane = Vec4{ 0, 1, 0, -waterheight + 0.05 };
refraction_clip_plane = Vec4{ 0, -1, 0, -waterheight };
}