• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FullCircles函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FullCircles函数的典型用法代码示例。如果您正苦于以下问题:C++ FullCircles函数的具体用法?C++ FullCircles怎么用?C++ FullCircles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		auto camera = CamMatrixf::Orbiting(
			Vec3f(),
			4.5,
			Degrees(time * 35),
			Degrees(SineWave(time / 30.0) * 60)
		);

		auto model =
			ModelMatrixf::RotationY(FullCircles(time * 0.25)) *
			ModelMatrixf::RotationX(FullCircles(0.25));

		Vec4f lightPos(4.0f, 4.0f, -8.0f, 1.0f);

		prog.Use();
		camera_matrix.Set(camera);
		model_matrix.Set(model);
		light_pos_cam.Set(camera * lightPos);

		front_color.Set(Vec3f(0.3f, 0.2f, 0.0f));
		back_color.Set(Vec3f(0.2f, 0.1f, 0.0f));
		gl.PolygonMode(PolygonMode::Line);
		torus_instr.Draw(torus_indices);

		front_color.Set(Vec3f(0.9f, 0.8f, 0.1f));
		back_color.Set(Vec3f(1.0f, 0.9f, 0.8f));
		gl.PolygonMode(PolygonMode::Fill);
		torus_instr.Draw(torus_indices);
	}
开发者ID:xdray,项目名称:oglplus,代码行数:32,代码来源:023_lattice_torus.cpp


示例2: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		// set the matrix for camera orbiting the origin
		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				4.0 - SineWave(time / 6.0) * 2.0,
				FullCircles(time * 0.4),
				Degrees(SineWave(time / 30.0) * 90)
			)
		);

		// set the model matrix
		model_matrix.Set(
			ModelMatrixf::RotationZ(FullCircles(time * 0.1))
		);

		cube.Bind();
		gl.CullFace(Face::Front);
		cube_instr.Draw(cube_indices);
		gl.CullFace(Face::Back);
		cube_instr.Draw(cube_indices);
	}
开发者ID:xdray,项目名称:oglplus,代码行数:25,代码来源:019_honeycomb_cube.cpp


示例3: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		Uniform<Mat4f>(prog, "cameraMatrix").Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				3.0 + std::sin(time)*1.5,
				FullCircles(time * 0.5),
				Degrees(std::sin(time * 0.5) * 70)
			)
		);

		Uniform<Mat4f>(prog, "modelMatrix").Set(
			ModelMatrixf::RotationA(
				Vec3f(1.0f, 1.0f, 1.0f),
				FullCircles(time * 0.4)
			)
		);
		Uniform<Vec3f>(prog, "lightPos").Set(Vec3f(1.0f, 2.0f, 3.0f*std::sin(time * 2.9)));

		vao.Bind();
		// This is not very effective
		shape.Instructions().Draw(shape.Indices());
	}
开发者ID:detunized,项目名称:oglplus,代码行数:25,代码来源:test03.cpp


示例4: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		auto camera = CamMatrixf::Orbiting(
			Vec3f(),
			4.5,
			Degrees(time * 35),
			Degrees(SineWave(time / 30.0) * 60)
		);

		auto model =
			ModelMatrixf::RotationY(FullCircles(time * 0.25)) *
			ModelMatrixf::RotationX(FullCircles(time * 0.33));

		camera_matrix.Set(camera);
		model_matrix.Set(model);
		transf_time.Set(time);

		face_pp.Bind();
		gl.PolygonMode(PolygonMode::Fill);
		torus_instr.Draw(torus_indices);

		frame_pp.Bind();
		gl.PolygonMode(PolygonMode::Line);
		torus_instr.Draw(torus_indices);
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:27,代码来源:024_extruded_torus.cpp


示例5: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		// set the matrix for camera orbiting the origin
		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				4.5 - SineWave(time / 16.0) * 2.0,
				FullCircles(time / 12.0),
				Degrees(SineWave(time / 30.0) * 90)
			)
		);

		// set the model matrix
		model_matrix.Set(
			ModelMatrixf::RotationA(
				Vec3f(1.0f, 1.0f, 1.0f),
				FullCircles(time / 10.0)
			)
		);

		shape.Bind();
		shape_instr.Draw(shape_indices);
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:25,代码来源:020_icosphere.cpp


示例6: Render

    void Render(double time) {
        const double day_duration = 67.0;
        auto sun =
          Vec3f(0.000, 1.000, 0.000) * 1e10 * SineWave(time / day_duration) +
          Vec3f(0.000, 0.000, -1.000) * 1e10 * CosineWave(time / day_duration);

        auto camera = CamMatrixf::Orbiting(
          Vec3f(),
          5.0,
          FullCircles(-0.10 - time / 27.0),
          Degrees(-20 - SineWave(time / 17.0) * 30));

        auto model = ModelMatrixf::RotationA(
          Vec3f(1.0, 1.0, 1.0), FullCircles(time / 13.0));

        gl.Clear().ColorBuffer().DepthBuffer();

        sky_box.Use();
        sky_box_prog.Use();
        sky_box_camera_matrix.Set(camera);
        sky_box_sun_position.Set(sun);
        sky_box.Draw();

        shape.Use();
        shape_prog.Use();
        shape_model_matrix.Set(model);
        shape_camera_matrix.Set(camera);
        shape_camera_position.Set(camera.Position());
        shape_sun_position.Set(sun);
        shape.Draw();
    }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:31,代码来源:023_sky.cpp


示例7: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();

		auto camera = CamMatrixf::Orbiting(
			Vec3f(),
			field.Radius()*(1.4 + SineWave(time / 6.0) * 0.2),
			FullCircles(time * 0.1),
			Degrees(SineWave(time / 30.0) * 90)
		);

		auto light = CamMatrixf::Orbiting(
			Vec3f(),
			field.Radius()*1.6,
			FullCircles(0.33-time * 0.07),
			Degrees(SineWave(time / 31.0) * 80)
		);

		prog.camera_matrix.Set(camera);
		prog.light_position.Set(light.Position());

		GLfloat fade_coef = 1.1*(1.0-CosineWave01(time / 90.0));
		prog.fade_coef.Set(fade_coef);

		field.Draw();
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:26,代码来源:028_monkeycraft.cpp


示例8: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		// set the matrix for camera orbiting the origin
		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				3.5,
				Degrees(time * 35),
				Degrees(SineWave(time / 20.0) * 60)
			)
		);
		// set the model matrix
		model_matrix.Set(
			ModelMatrixf::RotationY(FullCircles(time * 0.25)) *
			ModelMatrixf::RotationX(FullCircles(0.25))
		);

		gl.PolygonMode(PolygonMode::Line);
		gl.CullFace(Face::Front);
		torus_instr.Draw(torus_indices);
		//
		gl.PolygonMode(PolygonMode::Fill);
		gl.CullFace(Face::Back);
		torus_instr.Draw(torus_indices);
	}
开发者ID:detunized,项目名称:oglplus,代码行数:27,代码来源:016_cartoon_torus.cpp


示例9: Draw

	double Draw(double time)
	{
		assert(!shapes.empty());
		assert(ishape != shapes.end());
		shapes::ShapeWrapper& shape = *ishape;


		const double interval = 11.0;
		double segment = time - shape_time;
		double fade = segment*(interval-segment);
		fade -= 1.0;
		if(fade < 0.0) fade = 0.0;
		fade = std::sqrt(fade/interval);
		if(fade > 1.0) fade = 1.0;

		if(segment > interval)
		{
			if(++ishape == shapes.end())
			{
				ishape = shapes.begin();
			}
			shape_time = time;
		}

		gl.Clear().DepthBuffer();

		float dist = (1.0+SineWave(time / 13.0))*2.5;

		projection_matrix.Set(
			CamMatrixf::PerspectiveX(
				Degrees(45),
				1.0,
				1.0+dist,
				shape.BoundingSphere().Radius()*2.0+1.0+dist
			)
		);

		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				shape.BoundingSphere().Radius()+1.5+dist,
				FullCircles(time / 27.0),
				Degrees(SineWave(time / 23.0) * 89)
			)
		);
		model_matrix.Set(
			ModelMatrixf::RotationA(
				Vec3f(1,1,1),
				FullCircles(time /-37.0)
			)
		);

		prog.Use();
		shape.Use();
		shape.Draw();

		return fade;
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:58,代码来源:030_pin_display.cpp


示例10: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();

		CamMatrixf camera = CamMatrixf::Orbiting(
			Vec3f(),
			4.5f + float(SineWave(time / 25.0)),
			FullCircles(time / 30.0),
			Degrees(SineWave(time / 19.0) * 20)
		);
		light_prog.camera_matrix.Set(camera);
		flare_prog.camera_matrix.Set(camera);
		shape_prog.camera_matrix.Set(camera);
		shape_prog.camera_position.Set(camera.Position());

		shape_prog.model_matrix.Set(
			ModelMatrixf::RotationX(FullCircles(time / 30.0))
		);

		shape_prog.Use();
		shape.Draw();
		NoProgram().Use();

		lights.Bind();

		light_prog.Use();

		for(GLuint l=0; l!=n_flares; ++l)
		{
			queries[l].Begin(Query::Target::SamplesPassed);
			gl.DrawArrays(PrimitiveType::Points, l, 1);
			queries[l].End(Query::Target::SamplesPassed);
		}

		gl.Enable(Capability::Blend);
		gl.Disable(Capability::DepthTest);
		flare_prog.Use();
		for(GLuint l=0; l!=n_flares; ++l)
		{
			GLint samples = 0;
			queries[l].WaitForResult(samples);
			if(samples != 0)
			{
				flare_prog.samples = samples;
				gl.DrawArrays(PrimitiveType::Points, l, 1);
			}
		}
		gl.Enable(Capability::DepthTest);
		gl.Disable(Capability::Blend);
	}
开发者ID:xubingyue,项目名称:oglplus,代码行数:50,代码来源:029_flares.cpp


示例11: Render

	void Render(double time)
	{
		static const Mat4f reflection(
			Vec4f( 1.0, 0.0, 0.0, 0.0),
			Vec4f( 0.0,-1.0, 0.0, 0.0),
			Vec4f( 0.0, 0.0, 1.0, 0.0),
			Vec4f( 0.0, 0.0, 0.0, 1.0)
		);

		auto camera = CamMatrixf::Orbiting(
			Vec3f(),
			GLfloat(7.0 + SineWave(time / 12.0)*2.5),
			FullCircles(time / 10.0),
			Degrees(45.0 - SineWave(time / 7.0)*35.0)
		);

		shape_prog.Use();
		shape.Bind();

		gl.Enable(Capability::CullFace);
		gl.FrontFace(make_shape.FaceWinding());

		// render into the off-screen framebuffer
		fbo.Bind(Framebuffer::Target::Draw);
		gl.Viewport(
			(width - refl_tex_side) / 2,
			(height - refl_tex_side) / 2,
			refl_tex_side, refl_tex_side
		);
		gl.Clear().ColorBuffer().DepthBuffer();

		shape_camera_matrix.Set(
			camera *
			ModelMatrixf::Translation(0.0f, -1.0f, 0.0f) *
			reflection
		);

		gl.CullFace(Face::Front);
		shape_instr.Draw(shape_indices);

		gl.Bind(Framebuffer::Target::Draw, DefaultFramebuffer());
		gl.Viewport(width, height);
		gl.Clear().ColorBuffer().DepthBuffer();

		shape_camera_matrix.Set(camera);

		gl.CullFace(Face::Back);
		shape_instr.Draw(shape_indices);

		gl.Disable(Capability::CullFace);

		// Render the plane
		plane_prog.Use();
		plane.Bind();

		plane_camera_matrix.Set(camera);
		plane_camera_position.Set(camera.Position());

		plane_instr.Draw(plane_indices);
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:60,代码来源:030_pool_tiles.cpp


示例12: ModelMat

	Mat4f ModelMat(double time)
	{
		return ModelMatrixf::RotationA(
			Vec3f(1),
			FullCircles(time / 13.0)
		);
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:7,代码来源:029_gpu_sort_tfb.cpp


示例13: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		liquid_prog.time = time;


		auto camera = CamMatrixf::Orbiting(
			Vec3f(0, 0, 0),
			4.5 - SineWave(time / 14.0),
			FullCircles(time / 26.0),
			Degrees(55 + SineWave(time / 14.0) * 30)
		);
		Vec3f camera_position = camera.Position();

		liquid_prog.camera_position = camera_position;
		liquid_prog.camera_matrix = perspective*camera;

		for(int z=-grid_repeat; z!=grid_repeat; ++z)
		for(int x=-grid_repeat; x!=grid_repeat; ++x)
		{
			liquid_prog.grid_offset.Set(x, -0.5, z);
			grid.Draw();
		}

	}
开发者ID:JanChou,项目名称:oglplus,代码行数:26,代码来源:028_ripples.cpp


示例14: Render

	void Render(double time)
	{
		// update the particle positions, ages and directions
		GLuint i = 0;
		float time_diff = (time - prev_time);
		float age_mult = 0.2f;
		while(i != positions.size())
		{
			float drag = 0.1f * (time_diff);
			if((ages[i] += time_diff * age_mult) < 1.0f)
			{
				directions[i] *= (1.0f - drag);
				positions[i] += directions[i]*time_diff;
			}
			else
			{
				ages[i] = 0.0f;
				directions[i] = NewDirection();
				positions[i] = Vec3f();
			}
			++i;
		}
		// if there are not enough particles yet
		if(i != particle_count)
		{
			float spawn_interval = 1.0f/(age_mult*particle_count);
			if(prev_spawn + spawn_interval < time)
			{
				directions.push_back(NewDirection());
				positions.push_back(Vec3f());
				ages.push_back(0.0f);
				prev_spawn = time;
			}
		}
		prev_time = time;

		assert(positions.size() == directions.size());
		assert(positions.size() == ages.size());

		// upload the particle positions
		pos_buf.Bind(Buffer::Target::Array);
		Buffer::Data(Buffer::Target::Array, positions);
		// upload the particle ages
		age_buf.Bind(Buffer::Target::Array);
		Buffer::Data(Buffer::Target::Array, ages);

		gl.Clear().ColorBuffer().DepthBuffer();
		//
		// set the matrix for camera orbiting the origin
		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				18.0f,
				FullCircles(time * 0.5),
				Degrees(45)
			)
		);

		gl.DrawArrays(PrimitiveType::Points, 0, positions.size());
	}
开发者ID:xdray,项目名称:oglplus,代码行数:60,代码来源:018_particle_system.cpp


示例15: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();

		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				4.0,
				Degrees(time * 25),
				Degrees(SineWave(time / 30.0) * 90)
			)
		);

		model_matrix.Set(
			ModelMatrixf::RotationA(
				Vec3f(1.0f, 1.0f, 1.0f),
				FullCircles(time * 0.5)
			)
		);

		shape.Draw();

		thread_ready.Signal();
		parent_ready.Wait();
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:25,代码来源:025_rendered_texture_mt.cpp


示例16: Render

	void Render(double time)
	{
		const Vec3f light_position(16.0, 10.0, 9.0);
		const Vec3f torus_center(0.0, 1.5, 0.0);

		const Mat4f torus_matrix =
			ModelMatrixf::Translation(torus_center) *
			ModelMatrixf::RotationZ(FullCircles(time / 16.0));

		const Mat4f light_proj_matrix =
			CamMatrixf::PerspectiveX(Degrees(10), 1.0, 1, 80) *
			CamMatrixf::LookingAt(light_position, torus_center);

		transf_prog.light_position.Set(light_position);

		RenderFrameShadowMap(
			light_position,
			torus_matrix,
			light_proj_matrix
		);
		RenderGlassShadowMap(
			light_position,
			torus_center,
			torus_matrix,
			light_proj_matrix
		);
		RenderImage(
			time,
			torus_center,
			torus_matrix,
			light_proj_matrix
		);
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:33,代码来源:033_metal_and_glass.cpp


示例17: RenderImage

    void RenderImage(double time) {
        gl.Clear().ColorBuffer().DepthBuffer();
        //

        Mat4f perspective =
          CamMatrixf::PerspectiveX(Degrees(48), width, height, 1, 100);

        auto camera = CamMatrixf::Orbiting(
          Vec3f(0, 0, 0),
          GLfloat(4.0 - SineWave(time / 14.0)),
          FullCircles(time / 26.0),
          Degrees(45 + SineWave(time / 17.0) * 40));
        Vec3f camera_position = camera.Position();

        metal_prog.Use();
        metal_prog.camera_position.Set(camera_position);
        metal_prog.camera_matrix.Set(perspective * camera);

        plane.Use();
        plane.Draw();

        blob_prog.Use();
        blob_prog.camera_position.Set(camera_position);
        blob_prog.camera_matrix.Set(perspective * camera);

        grid.Use();

        int side = 1;
        for(int z = -side; z != side; ++z)
            for(int y = -side; y != side; ++y)
                for(int x = -side; x != side; ++x) {
                    blob_prog.grid_offset.Set(x, y, z);
                    grid.Draw();
                }
    }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:35,代码来源:031_blob.cpp


示例18: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();

		int period = int(time * 0.125);
		if(prev_period < period)
		{
			if(period % 2)
				gl.PolygonMode(PolygonMode::Line);
			else gl.PolygonMode(PolygonMode::Fill);
			prev_period = period;
		}

		auto camera = CamMatrixf::Orbiting(
			Vec3f(0.0f, 2.0f, 0.0f),
			17.0f - CosineWave(time / 31.0f) * 10.0f,
			FullCircles(time / 43.0f),
			Degrees(45 - SineWave(time / 29.0f) * 35)
		);
		camera_matrix.Set(camera);
		camera_position.Set(camera.Position());

		anim_time.Set(time);

		plane_instr.Draw(plane_indices);
	}
开发者ID:detunized,项目名称:oglplus,代码行数:26,代码来源:023_waves.cpp


示例19: Render

    void Render(ExampleClock& clock) {
        if(long(clock.Now().Seconds()) % 4 == 0) {
            status += clock.Interval().Seconds();
        } else if(status != double(long(status))) {
            if(status - double(long(status)) < 0.5)
                status = double(long(status));
            else
                status = 1.0 + double(long(status));
        }

        gl.Clear().ColorBuffer().DepthBuffer();

        point_prog.status = GLfloat(0.5 - 0.5 * CosineWave(status * 0.5));

        CamMatrixf camera = CamMatrixf::Orbiting(
          Vec3f(),
          5.5f,
          FullCircles(clock.Now().Seconds() / 19.0),
          Degrees(45 + SineWave(clock.Now().Seconds() / 15.0) * 40));
        point_prog.camera_matrix.Set(camera);

        point_prog.model_matrix.Set(
          ModelMatrixf::RotationX(RightAngles(status)));
        shape.Draw();
    }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:25,代码来源:021_morphing.cpp


示例20: Render

	void Render(double time)
	{
		gl.Clear().ColorBuffer().DepthBuffer();
		//
		// set the matrix for camera orbiting the origin
		camera_matrix.Set(
			CamMatrixf::Orbiting(
				Vec3f(),
				4.5f,
				FullCircles(time / 10.0),
				Degrees(45.0 + SineWave(time / 7.0)*30.0)
			)
		);
		model_matrix.Set(ModelMatrixf::RotationX(FullCircles(time / 12.0)));

		torus_instr.Draw(torus_indices);
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:17,代码来源:017_clipped_torus.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FullTextMatch函数代码示例发布时间:2022-05-30
下一篇:
C++ FtpSendCmd函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap