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


C++ Mat4::loadScale方法代码示例

本文整理汇总了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 };
}
开发者ID:Axbri,项目名称:ProceduralTerrainEngine,代码行数:30,代码来源:Water.cpp


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