太极图

HTML

 

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>太极图(动画)</title>
    <link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<div class="box">
    <!--universe(宇宙,领域)-->
<div class="universe"></div>
</div>

</body>
</html>

CSS

*{
    margin: 0;
    padding: 0;
}
.box{
    background: -moz-linear-gradient(top, green, orange);
    background: -webkit-gradient(linear, left top, left bottom, from(green), to(orange));
    -webkit-box-shadow:0px 5px 5px #c8c8c8 inset;
    -moz-box-shadow:0px 3px 3px #c8c8c8 inset;
    width:500px;
    height:500px;
    border:2px solid #fff;
    margin:30px auto;
    background-color:rgb(102, 153, 204);
    box-sizing:border-box;
    border-radius: 10px;
    box-shadow:5px 5px 5px orange,5px -5px 5px red,-5px 5px 5px green,-5px -5px 5px yellow;
}
/*一黑一白两个半圆*/
.universe{
    width: 0;
    height: 400px;
    position: relative;
    margin-top: 50px auto;
    border-left: 200px solid #000;
    border-right: 200px solid #fff;
    box-shadow: 0 0 30px rgba(0,0,0,.5);
    border-radius: 400px;
}
/*在这基础上加一个为after伪类一个白色圆形,定好位置*/
.universe:after{
    width: 200px;
    height: 200px;
    position: absolute;
    content: "";
    display: block;
    top: 0;
    left: -100px;
    z-index: 1;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 200px 0 #000;
}
/*同上面的原理一样在实现两个圆形,定好位置,太极图就实现了*/
.universe:after{
    width: 60px;
    height: 60px;
    top: 70px;
    left: -30px;
    z-index: 2;
    background-color: #000;
    border-radius: 50%;
    box-shadow: 0 200px 0 #fff;
}
.universe{
    width: 0;
    height: 400px;
    position: relative;
    margin: 50px auto;
    border-left: 200px solid #000;
    border-right: 200px solid #fff;
    box-shadow: 0 0 30px rgba(0,0,0,.5);
    border-radius: 400px;
    animation: rotation 2.5s linear infinite;
    -moz-animation: rotation 2.5s linear infinite;
    -webkit-animation: rotation 2.5s linear infinite;
}
.universe:before,.universe:after{
    position: absolute;
    content: "";
    display: block;
}
.universe:before{
    width: 200px;
    height: 200px;
    content: "";
    display: block;
    top: 0;
    left: -100px;
    z-index: 1;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 200px 0 #000;
}
.universe:after{
    width: 60px;
    height: 60px;
    top: 70px;
    left: -30px;
    z-index: 2;
    background-color: #000;
    border-radius: 50%;
    box-shadow: 0 200px 0 #fff;
}
/*然后添加一个css3动画*/
@keyframes rotation {
    0%{
        transform: rotate(0deg);
    }
    100%{
        transform: rotate(360deg);
    }
}
@-webkit-keyframes rotation {
    0%{
        -webkit-transform: rotate(0deg);
    }
    100%{
        -webkit-transform: rotate(360deg);
    }
 }
@-moz-keyframes rotation {
    0%{
        -moz-transform: rotate(0deg);
    }
    100%{
        -moz-transform: rotate(360deg);
    }
}

计算机图形学实验报告 SA03006073 魏思 介绍: 所有实验用一个MFC程序完成。组合成一个类似于画图程序。 程序左边面板上有所有的按钮,要完成功能只要点击相应按钮然后在客户区操作就可以了。 实验一、图元的生成 实验要求: 能够生成直线、圆、椭圆、可以按照给定的边界顶点完成区域填充。 实验内容: 直线生成: 使用Bresenhan方法绘制直线。 使用介绍:鼠标点击左边按钮区域的直线按钮,然后在右边客户区域内点下鼠标左键,拖动鼠标倒你想要绘制的地方,就可以形成一条直线。这个直线是用MFC提供的CDC类的LinetTo() 函数绘制的。然后开始自己的直线生成算法来重新绘制,使用红色的线条来绘制直线,系统提供的直线函数是用来做参考的。 椭圆和圆的生成: 使用Bresenhan方法绘制椭圆和圆。 使用介绍:和直线基本类似,鼠标点击按钮区域的椭圆或者是圆按钮,然后在右边客户区域内点下鼠标左键,拖动鼠标倒你想要绘制的地方,就可以形成一个圆或者是椭圆。这个圆或者是椭圆是使用MFC提供的CDC类的Ellipse() 函数绘制的。然后开始自己的椭圆和圆生成算法来重新绘制,使用红色的线条来绘制,系统提供的椭圆或者是圆函数是用来做参考的。 区域填充: 使用边扫描填充法完成区域填充 使用介绍:鼠标点击按钮区域的正方形按钮,会弹出一个输入对话框。在这个对话框里,输入包含你要求填充的区域的线条坐标。格式如下(以正方形为例): (0,0),(100,0) (100,0),(100,100) (100,100),(0,100) (0,100),(0,0) 点击确定以后,首先根据输入的线条坐标绘制出区域的边界。然后使用填充算法来填充区域。 为了方便观察,采用了延时100毫秒显示下一个点。所以有缓慢的感觉,不是算法的问题。 实验二、样条曲线的生成
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值