Git Product home page Git Product logo

opengl's Introduction

一、
这是一个用OpenGL绘制的能够显示当前系统时间的模拟时间。
二、
推荐使用Visual Studio运行该程序。
三、参考函数和相关知识
1)void myidle()//闲置响应函数
	{
		//当时间闲置时系统要做的事
	}
2)时钟相关知识
	注意,把系统时间取出后,分钟应考虑秒钟的影响,时钟应考虑分钟的影响。例如:
		mm=mm+ss/60
		hh=hh+mm/60
	时、分、秒绘制:
		关键是获取时分秒针终点的坐标。假设时针中心点(xc,yc),时分秒长度分别为RH,RM,RS
		秒针终止点
		xs = xc + RS* cos(PI / 2.0 - ss / 60 * 2 * PI);
		ys = yc + RS * sin(PI / 2.0 - ss / 60 * 2 * PI);
		分针终止点
		xm = xc + RM * cos(PI / 2.0 - (mm + ss / 60.0) / 60.0*2.0*PI);	
		ym = yc + RM * sin(PI / 2.0 - (mm + ss / 60.0) / 60.0*2.0*PI);	
		时针终止点
		xh = xc + RH*cos(PI / 2.0 - (hh + (mm + ss / 60.0) / 60.0) / 12.0*2.0*PI);	
		yh = yc + RH*sin(PI / 2.0 - (hh + (mm + ss / 60.0) / 60.0) / 12.0*2.0*PI);

opengl's People

Contributors

kris-fan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.