H5游戏开发:消灭星星

2018/01/25 · HTML5 ·
游戏

原文出处: 凹凸实验室   

「消灭星星」是一款很经典的「消除类游戏」,它的玩法很简单:消除相连通的同色砖块。

图片 1

H5游戏开发:一笔画

2017/11/07 · HTML5 ·
游戏

原文出处: 凹凸实验室   

图片 2

SQL 练习题答案

Last updated December 5, 2012.

1. 游戏规则

「消灭星星」存在多个版本,不过它们的规则除了「关卡分值」有些出入外,其它的规则都是一样的。笔者介绍的版本的游戏规则整理如下:

1. 色砖分布

  • 10 x 10 的表格
  • 5种颜色 —— 红、绿、蓝,黄,紫
  • 每类色砖个数在指定区间内随机
  • 5类色砖在 10 x 10 表格中随机分布

2. 消除规则

两个或两个以上同色砖块相连通即是可被消除的砖块。

3. 分值规则

  • 消除总分值 = n * n * 5
  • 奖励总分值 = 2000 – n * n * 20

「n」表示砖块数量。上面是「总」分值的规则,还有「单」个砖块的分值规则:

  • 消除砖块得分值 = 10 * i + 5
  • 剩余砖块扣分值 = 40 * i + 20

「i」表示砖块的索引值(从 0
开始)。简单地说,单个砖块「得分值」和「扣分值」是一个等差数列。

4. 关卡分值

关卡分值 = 1000 + (level – 1) * 2000;「level」即当前关卡数。

5. 通关条件

  • 可消除色块不存在
  • 累计分值 >= 当前关卡分值

上面两个条件同时成立游戏才可以通关。

H5游戏开发:一笔画

by leeenx on 2017-11-02

一笔画是图论[科普](https://zh.wikipedia.org/wiki/%E5%9B%BE%E8%AE%BA)中一个著名的问题,它起源于柯尼斯堡七桥问题[科普](https://zh.wikipedia.org/wiki/%E6%9F%AF%E5%B0%BC%E6%96%AF%E5%A0%A1%E4%B8%83%E6%A1%A5%E9%97%AE%E9%A2%98)。数学家欧拉在他1736年发表的论文《柯尼斯堡的七桥》中不仅解决了七桥问题,也提出了一笔画定理,顺带解决了一笔画问题。用图论的术语来说,对于一个给定的连通图[科普](https://zh.wikipedia.org/wiki/%E8%BF%9E%E9%80%9A%E5%9B%BE)存在一条恰好包含所有线段并且没有重复的路径,这条路径就是「一笔画」。

寻找连通图这条路径的过程就是「一笔画」的游戏过程,如下:

图片 3

 

Try searching this page for keywords like ‘segmentation’ or ‘PLY’.

2. MVC 设计模式

笔者这次又是使用了 MVC
模式来写「消灭星星」。星星「砖块」的数据结构与各种状态由 Model
实现,游戏的核心在 Model 中完成;View 映射 Model
的变化并做出对应的行为,它的任务主要是展示动画;用户与游戏的交互由
Control 完成。

从逻辑规划上看,Model 很重而View 与 Control
很轻,不过,从代码量上看,View 很重而 Model 与 Control 相对很轻。

游戏的实现

「一笔画」的实现不复杂,笔者把实现过程分成两步:

  1. 底图绘制
  2. 交互绘制

「底图绘制」把连通图以「点线」的形式显示在画布上,是游戏最容易实现的部分;「交互绘制」是用户绘制解题路径的过程,这个过程会主要是处理点与点动态成线的逻辑。

一、补充作业一、

 

设有三个关系:

               S(SNO, SNAME, AGE, SEX,Sdept)

               SC(SNO, CNO, GRADE)

               C(CNO, CNAME, TEACHER)

试用关系代数表达式表示下列查询:

 

1、查询学号为S3学生所学课程的课程名与任课教师名。

  

2、查询至少选修LIU老师所教课程中一门课的女生姓名。

3、查询WANG同学不学的课程的课程号。

4、查询至少选修两门课程的学生学号。

5、查询选修课程中包含LIU老师所教全部课程的学生学号。

补充作业二、

 

三个关系同上,试用SQL语言表示下列查询:

 

1、  查询门门课程都及格的学生的学号

方法1:

提示:根据学号分组,就得到每个学生所有的课程成绩,在某个学生这一组成绩里,如果他所有的课程成绩都大于60分则输出该组学生的学号

Select sno frome sc group by sno having(min(grade)>=60)

 

2、查询既有课程大于90分又有课程不及格的学生的学号

自身连接:

Select sno from sc where grade >90 and sno in (select sno from sc where grade<60)

 

3、查询平均分不及格的课程号和平均成绩

Select cno , avg(GRADE) from sc group by cno having avg(grade)<60

查询平均分及格的课程号和课程名

Select C.cno , Cname from SC,C where C.cno=SC.cno group by C.cno having avg(grade)>=60

 

4、找出至少选修了2号学生选修过的全部课程的学生号

提示:不存在这样的课程y,学生2选修了y,而学生x没有选。

SELECT DISTINCT Sno

   FROM SC as SCX

   WHERE NOT EXISTS

      (SELECT *

       FROM SC as SCY

       WHERE SCY.Sno =‘2’AND NOT EXISTS

                               (SELECT *

                                  FROM SC SCZ

                          WHERE SCZ.Sno=SCX.Sno AND SCZ.Cno=SCY.Cno))



5、求各门课程去掉一个最高分和最低分后的平均分

第一步,求所有成绩的平均分(去掉一个最高分和最低分)

select   avg(GRADE)   from   SC       where   GRADE   not   in (select   top   1   GRADE   from   SC order   by   GRADE)     and     GRADE   not   in (select   top   1   GRADE   from   SC order   by   GRADE   desc)  

第二步,将所有成绩按各门课程的课程号CNO分组

SELECT CNO avg(GRADE)   from   SC       where   GRADE   not   in (select   top  1  GRADE   from   SC order   by   GRADE)     and     GRADE   not   in (select   top  1  GRADE   from   SC order   by   GRADE   desc) group by CNO

If you would like to contribute links, please e-mail them
torms@dgp.toronto.edu.

3. Model

10 x 10 的表格用长度为 100 的数组可完美映射游戏的星星「砖块」。

[ R, R, G, G, B, B, Y, Y, P, P, R, R, G, G, B, B, Y, Y, P, P, R, R, G,
G, B, B, Y, Y, P, P, R, R, G, G, B, B, Y, Y, P, P, R, R, G, G, B, B, Y,
Y, P, P, R, R, G, G, B, B, Y, Y, P, P, R, R, G, G, B, B, Y, Y, P, P, R,
R, G, G, B, B, Y, Y, P, P, R, R, G, G, B, B, Y, Y, P, P, R, R, G, G, B,
B, Y, Y, P, P ]

1
2
3
4
5
6
7
8
9
10
11
12
[
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P,
R, R, G, G, B, B, Y, Y, P, P
]

R – 红色,G – 绿色,B – 蓝色,Y – 黄色,P – 紫色。Model
的核心任务是以下四个:

  • 生成砖墙
  • 消除砖块 (生成砖块分值)
  • 夯实砖墙
  • 清除残砖 (生成奖励分值)

底图绘制

「一笔画」是多关卡的游戏模式,笔者决定把关卡(连通图)的定制以一个配置接口的形式对外暴露。对外暴露关卡接口需要有一套描述连通图形状的规范,而在笔者面前有两个选项:

  • 点记法
  • 线记法

举个连通图 —— 五角星为例来说一下这两个选项。

图片 4

点记法如下:

JavaScript

levels: [ // 当前关卡 { name: “五角星”, coords: [ {x: Ax, y: Ay}, {x:
Bx, y: By}, {x: Cx, y: Cy}, {x: Dx, y: Dy}, {x: Ex, y: Ey}, {x: Ax, y:
Ay} ] } … ]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
levels: [
// 当前关卡
{
name: "五角星",
coords: [
{x: Ax, y: Ay},
{x: Bx, y: By},
{x: Cx, y: Cy},
{x: Dx, y: Dy},
{x: Ex, y: Ey},
{x: Ax, y: Ay}
]
}
]

线记法如下:

JavaScript

levels: [ // 当前关卡 { name: “五角星”, lines: [ {x1: Ax, y1: Ay, x2:
Bx, y2: By}, {x1: Bx, y1: By, x2: Cx, y2: Cy}, {x1: Cx, y1: Cy, x2: Dx,
y2: Dy}, {x1: Dx, y1: Dy, x2: Ex, y2: Ey}, {x1: Ex, y1: Ey, x2: Ax, y2:
Ay} ] } ]

1
2
3
4
5
6
7
8
9
10
11
12
13
levels: [
// 当前关卡
{
name: "五角星",
lines: [
{x1: Ax, y1: Ay, x2: Bx, y2: By},
{x1: Bx, y1: By, x2: Cx, y2: Cy},
{x1: Cx, y1: Cy, x2: Dx, y2: Dy},
{x1: Dx, y1: Dy, x2: Ex, y2: Ey},
{x1: Ex, y1: Ey, x2: Ax, y2: Ay}
]
}
]

「点记法」记录关卡通关的一个答案,即端点要按一定的顺序存放到数组
coords中,它是有序性的记录。「线记法」通过两点描述连通图的线段,它是无序的记录。「点记法」最大的优势是表现更简洁,但它必须记录一个通关答案,笔者只是关卡的搬运工不是关卡创造者,所以笔者最终选择了「线记法」。:)

 

Papers & Archives

3.1 生成砖墙

砖墙分两步生成:

  • 色砖数量分配
  • 打散色砖

理论上,可以将 100 个格子可以均分到 5
类颜色,不过笔者玩过的「消灭星星」都不使用均分策略。通过分析几款「消灭星星」,其实可以发现一个规律
—— 「色砖之间的数量差在一个固定的区间内」。

如果把传统意义上的均分称作「完全均分」,那么「消灭星星」的分配是一种在均分线上下波动的「不完全均分」。

图片 5

笔者把上面的「不完全均分」称作「波动均分」,算法的具体实现可以参见「波动均分算法」。

「打散色砖」其实就是将数组乱序的过程,笔者推荐使用「
费雪耶兹乱序算法」。

以下是伪代码的实现:

JavaScript

// 波动均分色砖 waveaverage(5, 4, 4).forEach( // tiles 即色墙数组
(count, clr) => tiles.concat(generateTiles(count, clr)); ); //
打散色砖 shuffle(tiles);

1
2
3
4
5
6
7
// 波动均分色砖
waveaverage(5, 4, 4).forEach(
// tiles 即色墙数组
(count, clr) => tiles.concat(generateTiles(count, clr));
);
// 打散色砖
shuffle(tiles);

交互绘制

在画布上绘制路径,从视觉上说是「选择或连接连通图端点」的过程,这个过程需要解决2个问题:

  • 手指下是否有端点
  • 选中点到待选中点之间能否成线

收集连通图端点的坐标,再监听手指滑过的坐标可以知道「手指下是否有点」。以下伪代码是收集端点坐标:

JavaScript

// 端点坐标信息 let coords = []; lines.forEach(({x1, y1, x2, y2})
=> { // (x1, y1) 在 coords 数组不存在 if(!isExist(x1, y1))
coords.push([x1, y1]); // (x2, y2) 在 coords 数组不存在
if(!isExist(x2, y2)) coords.push([x2, y2]); });

1
2
3
4
5
6
7
8
// 端点坐标信息
let coords = [];
lines.forEach(({x1, y1, x2, y2}) => {
// (x1, y1) 在 coords 数组不存在
if(!isExist(x1, y1)) coords.push([x1, y1]);
// (x2, y2) 在 coords 数组不存在
if(!isExist(x2, y2)) coords.push([x2, y2]);
});

以下伪代码是监听手指滑动:

JavaScript

easel.addEventListener(“touchmove”, e => { let x0 =
e.targetTouches[0].pageX, y0 = e.targetTouches[0].pageY; // 端点半径
—— 取连通图端点半径的2倍,提升移动端体验 let r = radius * 2;
for(let [x, y] of coords){ if(Math.sqrt(Math.pow(x – x0, 2) +
Math.pow(y – y0), 2) <= r){ // 手指下有端点,判断能否连线
if(canConnect(x, y)) { // todo } break; } } })

1
2
3
4
5
6
7
8
9
10
11
12
13
14
easel.addEventListener("touchmove", e => {
let x0 = e.targetTouches[0].pageX, y0 = e.targetTouches[0].pageY;
// 端点半径 —— 取连通图端点半径的2倍,提升移动端体验
let r = radius * 2;
for(let [x, y] of coords){
if(Math.sqrt(Math.pow(x – x0, 2) + Math.pow(y – y0), 2) <= r){
// 手指下有端点,判断能否连线
if(canConnect(x, y)) {
// todo
}
break;
}
}
})

在未绘制任何线段或端点之前,手指滑过的任意端点都会被视作「一笔画」的起始点;在绘制了线段(或有选中点)后,手指滑过的端点能否与选中点串连成线段需要依据现有条件进行判断。

图片 6

上图,点A与点B可连接成线段,而点A与点C不能连接。笔者把「可以与指定端点连接成线段的端点称作有效连接点」。连通图端点的有效连接点从连通图的线段中提取:

JavaScript

coords.forEach(coord => { // 有效连接点(坐标)挂载在端点坐标下
coord.validCoords = []; lines.forEach(({x1, y1, x2, y2}) => { //
坐标是当前线段的起点 if(coord.x === x1 && coord.y === y1) {
coord.validCoords.push([x2, y2]); } // 坐标是当前线段的终点 else
if(coord.x === x2 && coord.y === y2) { coord.validCoords.push([x1,
y1]); } }) })

1
2
3
4
5
6
7
8
9
10
11
12
13
14
coords.forEach(coord => {
// 有效连接点(坐标)挂载在端点坐标下
coord.validCoords = [];
lines.forEach(({x1, y1, x2, y2}) => {
// 坐标是当前线段的起点
if(coord.x === x1 && coord.y === y1) {
coord.validCoords.push([x2, y2]);
}
// 坐标是当前线段的终点
else if(coord.x === x2 && coord.y === y2) {
coord.validCoords.push([x1, y1]);
}
})
})

But…有效连接点只能判断两个点是否为底图的线段,这只是一个静态的参考,在实际的「交互绘制」中,会遇到以下情况:

图片 7
如上图,AB已串连成线段,当前选中点B的有效连接点是 A 与 C。AB
已经连接成线,如果 BA 也串连成线段,那么线段就重复了,所以此时 BA
不能成线,只有 AC 才能成线。

对选中点而言,它的有效连接点有两种:

  • 与选中点「成线的有效连接点」
  • 与选中点「未成线的有效连接点」

其中「未成线的有效连接点」才能参与「交互绘制」,并且它是动态的。

图片 8

回头本节内容开头提的两个问题「手指下是否有端点」 与
「选中点到待选中点之间能否成线」,其实可合并为一个问题:手指下是否存在「未成线的有效连接点」。只须把监听手指滑动遍历的数组由连通图所有的端点坐标
coords 替换为当前选中点的「未成线的有效连接点」即可。

至此「一笔画」的主要功能已经实现。可以抢先体验一下:

图片 9

 1、查询7号课程没有考试成绩的学生学号。

Graphics Conference Paper Link
Archive(Ke-Sen
Huang)

3.2 消除砖块

「消除砖块」的规则很简单 —— 相邻相连通相同色即可以消除

图片 10
前两个组合符合「相邻相连通相同色即可以消除」,所以它们可以被消除;第三个组合虽然「相邻相同色」但是不「相连通」所以它不能被消除。

「消除砖块」的同时有一个重要的任务:生成砖块对应的分值。在「游戏规则」中,笔者已经提供了对应的数学公式:「消除砖块得分值
= 10 * i + 5」。

「消除砖块」算法实现如下:

JavaScript

function clean(tile) { let count = 1; let sameTiles =
searchSameTiles(tile); if(sameTiles.length > 0) { deleteTile(tile);
while(true) { let nextSameTiles = []; sameTiles.forEach(tile => {
nextSameTiles.push(…searchSameTiles(tile)); makeScore(++count * 10 +
5); // 标记当前分值 deleteTile(tile); // 删除砖块 }); //
清除完成,跳出循环 if(nextSameTiles.length === 0) break; else {
sameTiles = nextSameTiles; } } } }

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function clean(tile) {
let count = 1;
let sameTiles = searchSameTiles(tile);
if(sameTiles.length > 0) {
deleteTile(tile);
while(true) {
let nextSameTiles = [];
sameTiles.forEach(tile => {
nextSameTiles.push(…searchSameTiles(tile));
makeScore(++count * 10 + 5); // 标记当前分值
deleteTile(tile); // 删除砖块
});
// 清除完成,跳出循环
if(nextSameTiles.length === 0) break;
else {
sameTiles = nextSameTiles;
}
}
}
}

清除的算法使用「递归」逻辑上会清晰一些,不过「递归」在浏览器上容易「栈溢出」,所以笔者没有使用「递归」实现。

自动识图

笔者在录入关卡配置时,发现一个7条边以上的连通图很容易录错或录重线段。笔者在思考能否开发一个自动识别图形的插件,毕竟「一笔画」的图形是有规则的几何图形。

图片 11

上面的关卡「底图」,一眼就可以识出三个颜色:

  • 白底
  • 端点颜色
  • 线段颜色

并且这三种颜色在「底图」的面积大小顺序是:白底 > 线段颜色 >
端点颜色。底图的「采集色值表算法」很简单,如下伪代码:

JavaScript

let imageData = ctx.getImageData(); let data = imageData.data; // 色值表
let clrs = new Map(); for(let i = 0, len = data.length; i < len; i +=
4) { let [r, g, b, a] = [data[i], data[i + 1], data[i + 2],
data[i + 3]]; let key = `rgba(${r}, ${g}, ${b}, ${a})`; let value =
clrs.get(key) || {r, g, b, a, count: 0}; clrs.has(key) ? ++value.count :
clrs.set(rgba, {r, g, b, a, count}); }

1
2
3
4
5
6
7
8
9
10
let imageData = ctx.getImageData();
let data = imageData.data;
// 色值表
let clrs = new Map();
for(let i = 0, len = data.length; i < len; i += 4) {
let [r, g, b, a] = [data[i], data[i + 1], data[i + 2], data[i + 3]];
let key = `rgba(${r}, ${g}, ${b}, ${a})`;
let value = clrs.get(key) || {r, g, b, a, count: 0};
clrs.has(key) ? ++value.count : clrs.set(rgba, {r, g, b, a, count});
}

对于连通图来说,只要把端点识别出来,连通图的轮廓也就出来了。

    Select sno fromsc where cno=’7′ and
grade is null

Reproducible
Researcharchive
(image processing, vision, machine learning) (Xin Li)

3.3 夯实砖墙

砖墙在消除了部分砖块后,会出现空洞,此时需要对墙体进行夯实:

向下夯实 向左夯实 向左下夯实(先下后左)

一种快速的实现方案是,每次「消除砖块」后直接遍历砖墙数组(10×10数组)再把空洞夯实,伪代码表示如下:

JavaScript

for(let row = 0; row < 10; ++row) { for(let col = 0; col < 10;
++col) { if(isEmpty(row, col)) { // 水平方向(向左)夯实
if(isEmptyCol(col)) { tampRow(col); } // 垂直方向(向下)夯实 else {
tampCol(col); } break; } } }

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
for(let row = 0; row < 10; ++row) {
for(let col = 0; col < 10; ++col) {
if(isEmpty(row, col)) {
// 水平方向(向左)夯实
if(isEmptyCol(col)) {
tampRow(col);
}
// 垂直方向(向下)夯实
else {
tampCol(col);
}
break;
}
}
}

But…
为了夯实一个空洞对一张大数组进行全量遍历并不是一种高效的算法。在笔者看来影响「墙体夯实」效率的因素有:

  1. 定位空洞
  2. 砖块移动(夯实)

扫描墙体数组的主要目的是「定位空洞」,但能否不扫描墙体数组直接「定位空洞」?

墙体的「空洞」是由于「消除砖块」造成的,换种说法 ——
被消除的砖块留下来的坑位就是墙体的空洞。在「消除砖块」的同时标记空洞的位置,这样就无须全量扫描墙体数组,伪代码如下:

JavaScript

function deleteTile(tile) { // 标记空洞 markHollow(tile.index); //
删除砖块逻辑 … }

1
2
3
4
5
6
function deleteTile(tile) {
// 标记空洞
markHollow(tile.index);
// 删除砖块逻辑
}

在上面的夯实动图,其实可以看到它的夯实过程如下:

  1. 空洞上方的砖块向下移动
  2. 空列右侧的砖块向左移动

墙体在「夯实」过程中,它的边界是实时在变化,如果「夯实」不按真实边界进行扫描,会产生多余的空白扫描:

图片 12

如何记录墙体的边界?
把墙体拆分成一个个单独的列,那么列最顶部的空白格片段就是墙体的「空白」,而其余非顶部的空白格片段即墙体的「空洞」。

图片 13

笔者使用一组「列集合」来描述墙体的边界并记录墙体的空洞,它的模型如下:

JavaScript

/* @ count – 列砖块数 @ start – 顶部行索引 @ end – 底部行索引 @
pitCount – 坑数 @ topPit – 最顶部的坑 @ bottomPit – 最底部的坑 */ let
wall = [ {count, start, end, pitCount, topPit, bottomPit}, {count,
start, end, pitCount, topPit, bottomPit}, … ];

1
2
3
4
5
6
7
8
9
10
11
12
13
/*
@ count – 列砖块数
@ start – 顶部行索引
@ end – 底部行索引
@ pitCount – 坑数
@ topPit – 最顶部的坑
@ bottomPit – 最底部的坑
*/
let wall = [
{count, start, end, pitCount, topPit, bottomPit},
{count, start, end, pitCount, topPit, bottomPit},
];

这个模型可以描述墙体的三个细节:

  • 空列
  • 列的连续空洞
  • 列的非连续空洞
JavaScript

// 空列 if(count === 0) { ... } // 连续空洞 else if(bottomPit -
topPit + 1 === pitCount) { ... } // 非连续空洞 else { ... }

<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr class="odd">
<td><div class="crayon-nums-content" style="font-size: 13px !important; line-height: 15px !important;">
<div class="crayon-num" data-line="crayon-5b8f3d2c2df29914802382-1">
1
</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5b8f3d2c2df29914802382-2">
2
</div>
<div class="crayon-num" data-line="crayon-5b8f3d2c2df29914802382-3">
3
</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5b8f3d2c2df29914802382-4">
4
</div>
<div class="crayon-num" data-line="crayon-5b8f3d2c2df29914802382-5">
5
</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5b8f3d2c2df29914802382-6">
6
</div>
<div class="crayon-num" data-line="crayon-5b8f3d2c2df29914802382-7">
7
</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5b8f3d2c2df29914802382-8">
8
</div>
<div class="crayon-num" data-line="crayon-5b8f3d2c2df29914802382-9">
9
</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5b8f3d2c2df29914802382-10">
10
</div>
<div class="crayon-num" data-line="crayon-5b8f3d2c2df29914802382-11">
11
</div>
<div class="crayon-num crayon-striped-num" data-line="crayon-5b8f3d2c2df29914802382-12">
12
</div>
</div></td>
<td><div class="crayon-pre" style="font-size: 13px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
<div id="crayon-5b8f3d2c2df29914802382-1" class="crayon-line">
// 空列
</div>
<div id="crayon-5b8f3d2c2df29914802382-2" class="crayon-line crayon-striped-line">
if(count === 0) { 
</div>
<div id="crayon-5b8f3d2c2df29914802382-3" class="crayon-line">
 ...
</div>
<div id="crayon-5b8f3d2c2df29914802382-4" class="crayon-line crayon-striped-line">
}
</div>
<div id="crayon-5b8f3d2c2df29914802382-5" class="crayon-line">
// 连续空洞
</div>
<div id="crayon-5b8f3d2c2df29914802382-6" class="crayon-line crayon-striped-line">
else if(bottomPit - topPit + 1 === pitCount) { 
</div>
<div id="crayon-5b8f3d2c2df29914802382-7" class="crayon-line">
 ...
</div>
<div id="crayon-5b8f3d2c2df29914802382-8" class="crayon-line crayon-striped-line">
}
</div>
<div id="crayon-5b8f3d2c2df29914802382-9" class="crayon-line">
// 非连续空洞
</div>
<div id="crayon-5b8f3d2c2df29914802382-10" class="crayon-line crayon-striped-line">
else {
</div>
<div id="crayon-5b8f3d2c2df29914802382-11" class="crayon-line">
 ...
</div>
<div id="crayon-5b8f3d2c2df29914802382-12" class="crayon-line crayon-striped-line">
}
</div>
</div></td>
</tr>
</tbody>
</table>

砖块在消除后,映射到单个列上的空洞会有两种分布形态 —— 连续与非连续。

图片 14

「连续空洞」与「非连续空洞」的夯实过程如下:

图片 15

其实「空列」放大于墙体上,也会有「空洞」类似的分布形态 ——
连续与非连续。
图片 16

它的夯实过程与空洞类似,这里就不赘述了。

端点识别

理论上,通过采集的「色值表」可以直接把端点的坐标识别出来。笔者设计的「端点识别算法」分以下2步:

  1. 按像素扫描底图直到遇到「端点颜色」的像素,进入第二步
  2. 从底图上清除端点并记录它的坐标,返回继续第一步

伪代码如下:

JavaScript

for(let i = 0, len = data.length; i < len; i += 4) { let [r, g, b,
a] = [data[i], data[i + 1], data[i + 2], data[i + 3]]; //
当前像素颜色属于端点 if(isBelongVertex(r, g, b, a)) { // 在 data
中清空端点 vertex = clearVertex(i); // 记录端点信息
vertexes.push(vertext); } }

1
2
3
4
5
6
7
8
9
10
for(let i = 0, len = data.length; i < len; i += 4) {
let [r, g, b, a] = [data[i], data[i + 1], data[i + 2], data[i + 3]];
// 当前像素颜色属于端点
if(isBelongVertex(r, g, b, a)) {
// 在 data 中清空端点
vertex = clearVertex(i);
// 记录端点信息
vertexes.push(vertext);
}
}

But…
上面的算法只能跑无损图。笔者在使用了一张手机截屏做测试的时候发现,收集到的「色值表」长度为
5000+ !这直接导致端点和线段的色值无法直接获得。

经过分析,可以发现「色值表」里绝大多数色值都是相近的,也就是在原来的「采集色值表算法」的基础上添加一个近似颜色过滤即可以找出端点和线段的主色。伪代码实现如下:

JavaScript

let lineColor = vertexColor = {count: 0}; for(let clr of clrs) { //
与底色相近,跳过 if(isBelongBackground(clr)) continue; //
线段是数量第二多的颜色,端点是第三多的颜色 if(clr.count >
lineColor.count) { [vertexColor, lineColor] = [lineColor, clr] } }

1
2
3
4
5
6
7
8
9
let lineColor = vertexColor = {count: 0};
for(let clr of clrs) {
// 与底色相近,跳过
if(isBelongBackground(clr)) continue;
// 线段是数量第二多的颜色,端点是第三多的颜色
if(clr.count > lineColor.count) {
[vertexColor, lineColor] = [lineColor, clr]
}
}

取到端点的主色后,再跑一次「端点识别算法」后居识别出 203
个端点!这是为什么呢?

图片 17

上图是放大5倍后的底图局部,蓝色端点的周围和内部充斥着大量噪点(杂色块)。事实上在「端点识别」过程中,由于噪点的存在,把原本的端点被分解成十几个或数十个小端点了,以下是跑过「端点识别算法」后的底图:

图片 18

通过上图,可以直观地得出一个结论:识别出来的小端点只在目标(大)端点上集中分布,并且大端点范围内的小端点叠加交错。

如果把叠加交错的小端点归并成一个大端点,那么这个大端点将十分接近目标端点。小端点的归并伪代码如下:

JavaScript

for(let i = 0, len = vertexes.length; i < len – 1; ++i) { let vertexA
= vertexes[i]; if(vertextA === undefined) continue; // 注意这里 j = 0
而不是 j = i +1 for(let j = 0; j < len; ++j) { let vertexB =
vertexes[j]; if(vertextB === undefined) continue; //
点A与点B有叠加,点B合并到点A并删除点B if(isCross(vertexA, vertexB)) {
vertexA = merge(vertexA, vertexB); delete vertexA; } } }

1
2
3
4
5
6
7
8
9
10
11
12
13
14
for(let i = 0, len = vertexes.length; i < len – 1; ++i) {
let vertexA = vertexes[i];
if(vertextA === undefined) continue;
// 注意这里 j = 0 而不是 j = i +1
for(let j = 0; j < len; ++j) {
let vertexB = vertexes[j];
if(vertextB === undefined) continue;
// 点A与点B有叠加,点B合并到点A并删除点B
if(isCross(vertexA, vertexB)) {
vertexA = merge(vertexA, vertexB);
delete vertexA;
}
}
}

加了小端点归并算法后,「端点识别」的准确度就上去了。经笔者本地测试已经可以
100% 识别有损的连通图了。

 

Mesh Libraries and Tools

3.4 消除残砖

上一小节提到了「描述墙体的边界并记录墙体的空洞」的「列集合」,笔者是直接使用这个「列集合」来消除残砖的,伪代码如下:

JavaScript

function clearAll() { let count = 0; for(let col = 0, len =
this.wall.length; col < len; ++col) { let colInfo = this.wall[col];
for(let row = colInfo.start; row <= colInfo.end; ++row) { let tile =
this.grid[row * this.col + col]; tile.score = -20 – 40 * count++; //
标记奖励分数 tile.removed = true; } } }

1
2
3
4
5
6
7
8
9
10
11
function clearAll() {
let count = 0;
for(let col = 0, len = this.wall.length;  col < len; ++col) {
let colInfo = this.wall[col];
for(let row = colInfo.start; row <= colInfo.end; ++row) {
let tile = this.grid[row * this.col + col];
tile.score = -20 – 40 * count++; // 标记奖励分数
tile.removed = true;
}
}
}

线段识别

笔者分两个步骤完成「线段识别」:

  1. 给定的两个端点连接成线,并采集连线上N个「样本点」;
  2. 遍历样本点像素,如果像素色值不等于线段色值则表示这两个端点之间不存在线段

如何采集「样式点」是个问题,太密集会影响性能;太疏松精准度不能保证。

在笔者面前有两个选择:N 是常量;N 是变量。
假设 N === 5。局部提取「样式点」如下:

图片 19

上图,会识别出三条线段:AB, BC 和 AC。而事实上,AC不能成线,它只是因为
AB 和 BC 视觉上共一线的结果。当然把 N 值向上提高可以解决这个问题,不过 N
作为常量的话,这个常量的取量需要靠经验来判断,果然放弃。

为了避免 AB 与 BC 同处一直线时 AC 被识别成线段,其实很简单 ——
两个「样本点」的间隔小于或等于端点直径
假设 N = S / (2 * R),S 表示两点的距离,R
表示端点半径。局部提取「样式点」如下:

图片 20

如上图,成功地绕过了 AC。「线段识别算法」的伪代码实现如下:

JavaScript

for(let i = 0, len = vertexes.length; i < len – 1; ++i) { let {x: x1,
y: y1} = vertexes[i]; for(let j = i + 1; j < len; ++j) { let {x:
x2, y: y2} = vertexes[j]; let S = Math.sqrt(Math.pow(x1 – x2, 2) +
Math.pow(y1 – y2, 2)); let N = S / (R * 2); let stepX = (x1 – x2) / N,
stepY = (y1 – y2) / n; while(–N) { // 样本点不是线段色
if(!isBelongLine(x1 + N * stepX, y1 + N * stepY)) break; } //
样本点都合格 —- 表示两点成线,保存 if(0 === N) lines.push({x1, y1, x2,
y2}) } }

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
for(let i = 0, len = vertexes.length; i < len – 1; ++i) {
let {x: x1, y: y1} = vertexes[i];
for(let j = i + 1; j < len; ++j) {
let {x: x2, y: y2} = vertexes[j];
let S = Math.sqrt(Math.pow(x1 – x2, 2) + Math.pow(y1 – y2, 2));
let N = S / (R * 2);
let stepX = (x1 – x2) / N, stepY = (y1 – y2) / n;
while(–N) {
// 样本点不是线段色
if(!isBelongLine(x1 + N * stepX, y1 + N * stepY)) break;
}
// 样本点都合格 —- 表示两点成线,保存
if(0 === N) lines.push({x1, y1, x2, y2})
}
}

 2、查询7号课程成绩在90分以上或60分以下的学生学号。

Surface_Mesh(D.
Sieger, M. Botsch)

4. View

View 主要的功能有两个:

  • UI 管理
  • 映射 Model 的变化(动画)

UI
管理主要是指「界面绘制」与「资源加载管理」,这两项功能比较常见本文就直接略过了。View
的重头戏是「映射 Model
的变化」并完成对应的动画。动画是复杂的,而映射的原理是简单的,如下伪代码:

JavaScript

update({originIndex, index, clr, removed, score}) { // 还没有
originIndex 或没有色值,直接不处理 if(originIndex === undefined || clr
=== undefined) return ; let tile = this.tiles[originIndex]; // tile
存在,判断颜色是否一样 if(tile.clr !== clr) { this.updateTileClr(tile,
clr); } // 当前索引变化 —– 表示位置也有变化 if(tile.index !== index)
{ this.updateTileIndex(tile, index); } // 设置分数 if(tile.score !==
score) { tile.score = score; } if(tile.removed !== removed) { //
移除或添加当前节点 true === removed ? this.bomb(tile) :
this.area.addChild(tile.sprite); tile.removed = removed; } }

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
update({originIndex, index, clr, removed, score}) {
// 还没有 originIndex 或没有色值,直接不处理
if(originIndex === undefined || clr === undefined) return ;
let tile = this.tiles[originIndex];
// tile 存在,判断颜色是否一样
if(tile.clr !== clr) {
this.updateTileClr(tile, clr);
}
// 当前索引变化 —– 表示位置也有变化
if(tile.index !== index) {
this.updateTileIndex(tile, index);
}
// 设置分数
if(tile.score !== score) {
tile.score = score;
}
if(tile.removed !== removed) {
// 移除或添加当前节点
true === removed ? this.bomb(tile) : this.area.addChild(tile.sprite);
tile.removed = removed;
}
}

Model 的砖块每次数据的更改都会通知到 View 的砖块,View
会根据对应的变化做对应的动作(动画)。

性能优化

由于「自动识图」需要对图像的的像素点进行扫描,那么性能确实是个需要关注的问题。笔者设计的「自动识图算法」,在识别图像的过程中需要对图像的像素做两次扫描:「采集色值表」
与 「采集端点」。在扫描次数上其实很难降低了,但是对于一张 750 * 1334
的底图来说,「自动识图算法」需要遍历两次长度为
750 * 1334 * 4 = 4,002,000
的数组,压力还是会有的。笔者是从压缩被扫描数组的尺寸来提升性能的。

被扫描数组的尺寸怎么压缩?
笔者直接通过缩小画布的尺寸来达到缩小被扫描数组尺寸的。伪代码如下:

JavaScript

// 要压缩的倍数 let resolution = 4; let [width, height] = [img.width
/ resolution >> 0, img.height / resolution >> 0];
ctx.drawImage(img, 0, 0, width, height); let imageData =
ctx.getImageData(), data = imageData;

1
2
3
4
5
// 要压缩的倍数
let resolution = 4;
let [width, height] = [img.width / resolution >> 0, img.height / resolution >> 0];
ctx.drawImage(img, 0, 0, width, height);
let imageData = ctx.getImageData(), data = imageData;

把源图片缩小4倍后,得到的图片像素数组只有原来的
4^2 = 16倍。这在性能上是很大的提升。

Select sno from sc where cno=’7′ and grade
not between 60and 90

GTS(2D
dynamic/constrained Delaunay triangulation, robust geometric predicates,
mesh boolean set operations, refinement/coarsening, view-independent
continuous LOD, view-dependent LOD, AABB-trees, Kd-trees, graph
partitioning, isosurfacing, area, volume, mean/gaussian/principal
curvature, stripification)

5. Control

Control 要处理的事务比较多,如下:

  • 绑定 Model & View
  • 生成通关分值
  • 判断通关条件
  • 对外事件
  • 用户交互

初始化时,Control 把 Model 的砖块单向绑定到 View 的砖块了。如下:

Object.defineProperties(model.tile, { originIndex: { get() {…}, set(){
… view.update({originIndex}) } }, index: { get() {…}, set() { …
view.update({index}) } }, clr: { get() {…}, set() { …
view.update({clr}) } }, removed: { get() {…}, set() { …
view.update({removed}) } }, score: { get() {…}, set() { …
view.update({score}) } } })

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Object.defineProperties(model.tile, {
    originIndex: {
        get() {…},
        set(){
            …
            view.update({originIndex})
        }
    },  
    index: {
        get() {…},
        set() {
            …
            view.update({index})
        }
    },
    clr: {
        get() {…},
        set() {
            …
            view.update({clr})
        }
    },
    removed: {
        get() {…},
        set() {
            …
            view.update({removed})
        }
    },  
    score: {
        get() {…},
        set() {
            …
            view.update({score})
        }
    }
})
 

「通关分值」与「判断通关条件」这对逻辑在本文的「游戏规则」中有相关介绍,这里不再赘述。

对外事件规划如下:

name detail
pass 通关
pause 暂停
resume 恢复
gameover 游戏结束

用户交互 APIs 规划如下:

name type deltail
init method 初始化游戏
next method 进入下一关
enter method 进入指定关卡
pause method 暂停
resume method 恢复
destroy method 销毁游戏

使用「自动识图」的建议

尽管笔者在本地测试的时候可以把所有的「底图」识别出来,但是并不能保证其它开发者上传的图片能否被很好的识别出来。笔者建议,可以把「自动识图」做为一个单独的工具使用。

笔者写了一个「自动识图」的单独工具页面:
可以在这个页面生成对应的关卡配置。

 

trimesh2 mesh
library(read
PLY/OFF/3DS/OBJ, write PLY/OFF/OBJ, subdivision, smoothing, curvature
estimation, triangle stripping, ICP, cleanup, decimation, basic shapes)
(S. Rusinkiewicz)

6. 问题

在知乎有一个关于「消灭星星」的话题:popstar关卡是如何设计的?

这个话题在最后提出了一个问题 ——
「无法消除和最大得分不满足过关条件的矩阵」

图片 21

「无法消除的矩阵」其实就是最大得分为0的矩阵,本质上是「最大得分不满足过关条件的矩阵」。

最大得分不满足过关条件的矩阵
求「矩阵」的最大得分是一个
「背包问题」,求解的算法不难:对当前矩阵用「递归」的形式把所有的消灭分支都执行一次,并取最高分值。但是
javascript 的「递归」极易「栈溢出」导致算法无法执行。

其实在知乎的话题中提到一个解决方案:

网上查到有程序提出做个工具随机生成关卡,自动计算,把符合得分条件的关卡筛选出来

这个解决方案代价是昂贵的!笔者提供有源码并没有解决这个问题,而是用一个比较取巧的方法:进入游戏前检查是事为「无法消除矩阵」,如果是重新生成关卡矩阵

注意:笔者使用的取巧方案并没有解决问题。

结语

下面是本文介绍的「一笔画」的线上
DEMO 的二维码:

图片 9

游戏的源码托管在:
其中游戏实现的主体代码在:
自动识图的代码在:

感谢耐心阅读完本文章的读者。本文仅代表笔者的个人观点,如有不妥之处请不吝赐教。

感谢您的阅读,本文由 凹凸实验室
版权所有。如若转载,请注明出处:凹凸实验室()

1 赞 1 收藏
评论

图片 23

 3、查询课程名以“数据”两个字开头的所有课程的课程号和课程名。

OpenMesh(PLY/OBJ,
halfedge mesh, decimation, Loop/Sqrt3 subdivision, view-dependent
progressive meshes, stripification) (J. Möbius, M. Habbecke)

7. 结语

下面是本文介绍的「消灭星星」的线上 DEMO 的二维码:

图片 24

游戏的源码托管在:

感谢耐心阅读完本文章的读者。本文仅代表笔者的个人观点,如有不妥之处请不吝赐教。
如果对「H5游戏开发」感兴趣,欢迎关注我们的专栏。

Select cno,cname from c where cname like
‘数据%’

CGAL(2D/3D halfedge
mesh, tet meshes) [full packages
list]
(Authors)

参考资料

  • Knapsack problem
  • NP-completeness
  • popstar关卡是如何设计的?
  • 费雪耶兹乱序算法
  • 波动均分算法

    1 赞 收藏
    评论

图片 23

 

MeshLab(import
PLY/STL/OFF/OBJ/3DS/COLLADA/PTX/V3D/PTS/APTS/XYZ/GTS/TRI/ASC/X3D/X3DV/VRML/ALN,
export PLY/STL/OFF/OBJ/3DS/COLLADA/VRML/DXF/GTS/U3D/IDTF/X3D,
selection/smoothing painting, linear measurements, export planar slices,
mesh decimation/repair/optimization, mesh alignment) [All
Filters]
(Authors)

 4、查询每个学生所有课程的平均成绩,输出学生学号和平均成绩。

OpenFlipper(import/export
OFF/OBJ/PLY/STL/STLA/STLB/OM, selection tools w/ surface/volume lasso
and sphere brush, decimation, smoothing, edge/face editing) (J. Möbius)

    Select sno,avg(grade)from sc group by
sno

mview(read/view
PMesh/GTS/OFF/COFF/PLY/VRML/Shallo/VTK ASCII POLYDATA/OBJ) (H. Cantzler,
T. Breckon)

 5、查询每门课程的选修人数,输出课程号和选修人数。

PLY
Tools(read/write
PLY)

    Selectcno,count(*) from sc group by
cno

ply2vri(convert
PLY mesh to signed-distance volumetric grid, VRI/PPM formats) (B.Allen)

 6、查询选修7号课程的学生的学号、姓名、性别。

JMeshLib(read/write
OFF/PLY/STL/VRML1/VRML2/OBJ/IV 2.1) (M. Attene)

    Selects.sno,sname,ssex from s,sc where
s.sno=sc.sno and cno=’7′

ReMESH(automatic
manifold repair, isolated component removal, hole filling, handle
removal, degenerate triangle removal, sharp feature recovery, defect
detection and hilighting, manual repair tools) (M. Attenne)

    或: Select sno,sname,ssex from s
where sno in

GPUmesh – Easy Cross-Plateform Cross-API Mesh Management for
GPUs(S.
Lefebvre)

              ( Select sno from sc where
cno=’7′ )

A48:
A Dynamic Adaptive Mesh Library based on Stellar Operators (L. Velho)

 7、查询选修7号课程的学生的平均年龄。

Volumetric
Mesh:
tetrahedral and cube volumetric 3D meshes (J. Barbic)

    Selectavg(sage) from s,sc where
s.sno=sc.sno and cno=’7′

3d-workspace(quadric
mesh simplification, re-meshing,
recursive/monte-carlo/sphere-packing/voxel sampling, skeleton
extraction, Laplacian/scale-dependent/mean-curvature-flow smoothing,
Sqrt3/Loop/modified-butterfly/longest-edge subdivision, minimum bounding
box, mean value coordinates, Green coordinates, curvature (polynomial
fitting, two other implementations), FFD, voxel deformation, skinning
with dual quaternions, mesh voxelization, octree, kd-tree, colormap,
mesh slicing)
(Authors)

    或: Select avg(sage) from s where sno
in

SimplexMesh:
general non-manifold, non-regular simplicial mesh for mixed dimensions
\leq 3 (C. Batty)

              (Select sno from sc where
cno=’7′ )

Shape Modeling

 8、查询有30名以上学生选修的课程号。

CGAL Subdivision
Demo(Sqrt3,
Quad-Triangle, Catmull-Clark, Doo-Sabin) (L.-J. Shiue, P. Alliez, R.
Ursu, L. Kettner)

    Select cno fromsc group by cno having
count(*)>30

interactive mesh
deformation(S.
Yoshizawa)

 9、查询至今没有考试不及格的学生学号。

manifold harmonics shape
deformation(B.
Vallet, B. Lévy)

    Select distinctsno from sc where sno
not in

Graphite(Catmull-Clark
subdivision)
(Authors)

         ( Select sno from sc where
grade<60 )

MeshLab(loop/butterfly/midpoint
subdivision)
(Authors)

    或: Select sno from sc group by sno
havingmin(grade)>=60

3D Model Synthesis from
examples(P.
Merrell)

10、查询所有考试成绩的平均分相同的学生学号分组

ShapeShop: sketch-based hierarchical implicit surface (“BlobTree”)
modeling (and
SurfaceTree)(R.
Schmidt, B. Wyvill, K. Singh)

二、

Real-time implicit surface
polygonizer(R.
Schmidt)

 1、找出选修课程号为C2的学生学号与成绩。

As-rigid-as-possible 2D shape
manipulation(R.
Schmidt)

Select sno,grade from sc where
cno=’C2′

Similarity-Based Surface
Modelling(S.
Zelinka)

 

Mesh Modelling Using Curve
Analogies(S.
Zelinka)

 2、找出选修课程号为C4的学生学号与姓名。

2D laplacian curve
editing(O.
Sorkine)

    Selects.sno,sname from s,sc where
s.sno=sc.sno and cno=’C4′

Convolution Surfaces for Line Skeletons with Polynomial Weight
Distributions(X.
Jin, J. Feng, Q. Peng, C-L. Tai)

    注意本题也可以用嵌套做

CARVErobust
boolean operations between arbitrary polygonal models (T. Sargeant)

思考本题改为“找出选修课程号为C4的学生学号、姓名与成绩”后还能用嵌套做吗?

GeoBrush: Interactive Mesh Geometry
Cloning(discrete
expmap, 3D Green coordinates deformation, GPU Poisson solver) (K.
Takayama, R. Schmidt, K. Singh, T. Igarashi, T. Boubeker, O. Sorkine)

 

MeshFlow: Interactive Visualization of Mesh Construction
Sequences(J.
Denning, W. Kerr, F. Pellacini)

 3、找出选修课程名为 Maths
的学生学号与姓名。

3D Modeling with
Silhouettes(A.
Rivers, F. Durand, T. Igarashi)

    Selects.sno,sname from s,sc,c

Apparent Layer Operations for the Manipulation of Deformable
Objects(T.
Igarashi, J. Mitani)

    where  s.sno=sc.sno and c.cno=sc.cno
andcname=’Maths’

Mesh Snapping: Robust Interactive Mesh Cutting Using Fast Geodesic
Curvature
Flow(J.
Zhang, C. Wu, J. Cai, J. Zheng, X-C. Tai)

注意本题也可以用嵌套做

Mixed Finite Elements for Variational Surface
Modeling(A.
Jacobson, E. Tosun, O. Sorkine, D. Zorin)

 

Bounded Biharmonc Weights for Real-Time
Deformation(A.
Jacobson, I. Baran, J. Popović, O. Sorkine)

 4、找出选修课程号为C2或C4的学生学号。

DT-Grid: data structure for high-resolution level
sets(open
and closed surfaces, dilation, CSG, texture coordinates, conversion from
OBJ/PLY, to PLY) (M. Nielsen, K. Museth)

    Select distinctsno from sc where cno
in (‘C2′,’C4’)

Shape Space Exploration of Constrained
Meshes(Y-L.
Yang, Y.-J. Yang, H. Pottmann, N. Mitra)

或: Select distinct sno from sc where
cno=’C2′ or cno=’C4′

Slices: A Shape-proxy Based on Planar
Sections(J.
McCrae, K. Singh, N. Mitra)

 

EXPLORATION OF CONTINUOUS VARIABILITY IN COLLECTIONS OF 3D
SHAPES(M.
Ovsjanikov, W. Li, L. Guibas, N. Mitra)

 5、找出选修课程号为C2和C4的学生学号。

GlobFit: Consistently Fitting Primitives by Discovering Global
Relations(data)
(Y. Li, X. Wu, Y. Chrysanthou, A. Sharf, D. Cohen-Or, N. Mitra)

    Select sno fromsc where cno=’C2′ and
sno in

Detail-Replicating Shape
Stretching(Implicit
mesh fairing using curvature flow, patch-based texture synthesis, octree
with ray tracing, bézier splines) (I. Alhashim)

         ( Select sno from sc where
cno=’C4′ )

Volumetric Modeling with Diffusion
Surfaces(K.
Takayama, O. Sorkine, A. Nealen, T. Igarashi)

    注意本题也可以用连接做

Metropolis Procedural
Modeling(J.
Talton, Y. Lou, S. Lesser, J. Duke, R. Mech, V. Koltun)

思考:Select distinct sno from sc where
cno=’C2′ andcno=’C4’正确吗?

siteplan: rapid architectural prototyping using procedural
extrusions(T.
Kelly, P. Wonka)

 

mesh-talent
(gauss-newton solver, (unknown) graph-based mesh deformation)
(Authors)

 6、找出不学C2课程的学生姓名和年龄。

Smooth Shape-Aware Functions with Controlled
Extrema(A.
Jacobson, T. Weinkauf, O. Sorkine)

    Selectsname,sage from s where sno not
in

SESAME: Sketch, Extrude, Sculpt and Manipulate
Easily(J.
Y. Oh)

         ( Selectsno from sc where
cno=’C2′ )

Virtual
LEGO(J.
Y. Oh)

    或: Select sname,sage from s where
not exists

Easy Mesh
Cutting(Z.
Ji, L. Liu, Z. Chen, G. Wang)

              (Select * from sc where
sno=s.sno and cno=’C2′ )

sculpt: simple level set sculpting
program(multi-resolution
point splatting) (R. Bridson)

 

Segmentation

 7、找出选修了数据库课程的所有学生姓名。(同3)

efpisoft: hierarchical mesh segmentation based on fitting
primitives(M.
Attene)

    Select snamefrom s,sc,c

mesh segmentation benchmark database and
viewer(X.
Chen, A. Golovinskiy, T. Funkhouser)

where  s.sno=sc.snoand c.cno=sc.cno and
cname=’数据库’

Graphite(variational
shape
approximation,image
vectorization)
[documentation
wiki]
(Authors)

 

SegMatch: Shape Segmentation and Shape Matching from Point
Cloud(T.
Dey, S. Goswami)

 8、找出数据库课程不及格的女生姓名。

ShapeAnnotatorsegmentation
tool (fitting primitives, barycentric/height/integral geodesic Morse,
Plumber, Lloyd
clustering)(Authors)

    连接:Select sname from s,sc,c

Shape Diameter Function (SDF) segmentation
tool(L.
Shapira)

         where  s.sno=sc.sno
andc.cno=sc.cno and cname=’数据库’

Parameterization

                and grade<60 and
ssex=’女’

fast stretch-minimizing
parameterization(includes
shape-preserving/Tutte/harmonic parameterization, and natural conformal
parameterization ) (S. Yoshizawa)

    嵌套:Select sname from s where
ssex=’女’ and  sno in

Graphite(ABF,
ABF++, DPBF, LSCM, HLSCM, Barycentric, mean-value coordinates, L2
stretch,spectral
conformal,Periodic
Global
Parameterization,Constrained
texture
mapping,texture
atlas
generation)
[documentation
wiki]
(Authors)

               (Select sno from sc where
grade<60 and cno in

CGAL(LSCM, discrete
conformal/authalic, Floater mean-value, Tutte barycentric) [full
packages
list]
(Authors)

                     ( Select cno from c
where cname=’数据库’ )

linear discrete conformal
parameterization(K.
Crane)

               )

Discrete Exponential Map
Demo(R.
Schmidt)

 

Local/Global Approach to Mesh
Parameterization(ARAP,
ASAP) (L. Liu, L. Zhang, Y. Xu, G. Gotsman, S. Gortler)

 9、找出各门课程的平均成绩,输出课程名和平均成绩。

Mesh Processing

    Selectcname,avg(grade) from
sc,c

mesh smoothing/denoising by averaging with similarity-based
weights(S.
Yoshizawa)

    wherec.cno=sc.cno  group by
c.cno,cname

estimating curvature tensors on triangle meshes with
CGAL(P.
Alliez)

思考本题也可以用嵌套做吗?

Graphite(mesh
curvature,uniform
remeshing,mesh
repair,volume
meshing,manifold
harmonics,appearance-preserving
simplification,normal
mapping)
[documentation
wiki]
(Authors)

 

CGAL(mesh
simplification, mesh ridges/umbilics, mesh curvature)[full packages
list]
(Authors)

10、找出各个学生的平均成绩,输出学生姓名和平均成绩。

MeshLab(discrete
curvature, monte-carlo/stratified/poisson-disk mesh sampling, Hausdorff
distance between meshes, uniform remeshing, voronoi vertex clustering,
laplacian/Taubin smoothing, mesh unsharp mask, geodesic distances)
[All
Filters]
(Authors)

    Selectsname,avg(grade) from
s,sc

Simplification
Envelopesgenerate
mesh level-of-detail hierarchies (J. Cohen, A. Varshney, G. Turk)

    wheres.sno=sc.sno group by
s.sno,sname

Volfillfill
holes in mesh using volumetric diffusion (S. Marschner, K. Berglund)

思考本题也可以用嵌套做吗?

trimeshinfo: compute mesh
properties(manifold,
genus, orientation, volume, self-intersection, boundaries, connected
components, …)
(Authors)

 

Discrete Laplace Operator on Meshed
Surfaces(J.
Sun, M. Belkin, Y. Wang)

11、找出至少有30个学生选修的课程名。

QualMesh: Delaunay meshing of surfaces and
volumes(T.
Dey, T. Ray)

    Select cnamefrom c where cno in

DelIso: delaunay meshing of
isosurfaces(T.
Dey, J. Levine)

         ( Selectcno from sc group by cno
having count(*)>=30 )

SurfRemesh: Delaunay Remeshing of Polygonal
Surfaces(T.
Dey, T. Ray)

注意本题也可以用连接做

DelPSC: delaunay mesh generation for surfaces, volumes and
complexes(T.
Dey, J. Levine)

 

TriMesh2MT: convert polygon mesh to
Multi-Triangulation(M.
Attenne, E. Danovaro, P. Magillo)

12、找出选修了不少于3门课程的学生姓名。

approximating gradients on meshes and point coulds via diffusion
metric(C.
Luo, I. Safa, Y. Wang)

    Select snamefrom s where sno in

geodesic: multiple source/target exact geodesic algorithm for
triangular
mesh(unknown)

         ( Selectsno from sc group by sno
having count(*)>=3 )

IsoEx: Feature Sensitive Mesh
Extraction(L.
Kobbelt, M. Botsch, Schwanecke, H.P. Seidel)

注意本题也可以用连接做

discrete connections and smooth vector fields on triangle
meshes(K.
Crane, M. Desbrun, P. Schroder)

 

Scapeterrain
simplification (M. Garland)

13、找出各门课程的成绩均不低于90分的学生姓名。

Terraterrain
simplification (M. Garland)

   Select snamefrom s,sc where
s.sno=sc.sno

QSlimmesh
simplification software (M. Garland)

         group bys.sno,sname having
min(grade)>=90

Permission
Gridmesh
simplification (S. Zelinka)

方法二:

Topology-based Smoothing of 2D Scalar Fields with
C1-Continuity[Page]
(T. Weinkauf, Y. Gingold, O. Sorkine)

Select sname from s where sno not
in

HanTun: computing handle and tunnel loops in 3D
models(T.
Dey, K. Li)

         ( Selectsno from sc where
grade<90 )

Non-Iterative, Feature-Preserving Mesh
Smoothing(also
[Page])
(T. Jones)

只要有一门不小于90分就会输出该学生学号

Efficient Implementation of Marching Cubes’ Cases with Topological
Guarantees(T.
Lewiner, H. Lopes, A. Viera, G. Tavares)

 

Direct Spherical Harmonic Transform of a Triangulated
Mesh(M.
Mousa, R. Chaine, S. Akkouche)

14、找出数据库课程成绩不低于该门课程平均分的学生姓名。

Normalizing for Anisotropy in Triangle
Models(M.
Kazhdan)

    Select snamefrom s,sc,c

Symmetry Descriptors and 3D Shape
Matching(M.
Kazhdan)

    where  s.sno=sc.sno and sc.cno=c.cno
and cname=’数据库’ and grade>

Unconstrained Isosurface Extraction on Arbitrary
Octrees(M.
Kazhdan)

         ( Selectavg(grade) from
sc,c

Fast Mean-Curvature Flow via Finite-Elements
Tracking(M.
Kazhdan)

           where sc.cno=c.cnoand
cname=’数据库’

Interactive and Anisotropic Geometry Processing Using the Screened
Poisson
Equation(M.
Kazhdan)

         )

Blended Intrinsic
Maps(V.
Kim, Y. Lipman, T. Funkhouser)

15、找出各个系科男女学生的平均年龄和人数。

Spin Transforms of Discrete
Surfaces(K.
Crane, U. Pinkall, P. Schröder)

    Selectsdept,ssex,avg(sage),count(*)
from s group by sdept,ssex

shapeDNA:
compute accurate eigenvalues and eigenfunctions of the Laplace Beltrami
operator using higher order FEM with Dirichlet or Neumann boundary
conditions (cubic FEM, global mesh refinement, tangential smoothing,
PLY, SMF, OBJ, OFF, VTK, ASC3D, STL) (M. Reuter)

16、找出计算机系(JSJ)课程平均分最高的学生学号和姓名。

Manifold Mesh
Processing(non-manifold
repair, smoothing, normals from point clouds, curvature calculation,
local shape descriptors, Polymender manifold mesh from triangle soup,
mesh simplification) (C. Grimm)

    Selects.sno,sname from s,sc where
s.sno=sc.sno and sdept=’JSJ’

GMSH: a three-dimensional finite element mesh generator with built-in
pre- and post-processing
facilities(procedural
parameterized geometry, 1/2/3D simplicial finite element meshing,
element size control, scalar/vector/tensor datasets) (C. Geuzaine, J.-F.
Remacle)

    group bys.sno,sname

Skeleton Extraction by Mesh
Contraction(O.
Au, C.-L. Tai, H.-K. Chu, D. Cohen-Or, T.-Y. Lee)

    havingavg(grade) >=ALL

Polymender mesh
repairer(water-tightness,
closed surface repair, sharp features, signed volume generation) (T. Ju)

         ( Selectavg(grade) from
s,sc

Algorithms to Automatically Quantify the Geometric Similarity of
Anatomical
Surfaces(D.
Boyer, Y. Lipman, E. St Clair, J. Puente, B. Patel, T. Funkhouser, J.
Jernvall, I. Daubechies)

           wheres.sno=sc.sno and
sdept=’JSJ’

Discrete Laplacians on General Polygonal
Meshes(M.
Alexa, M. Wardetzky)

           group bys.sno

meshfix(dilation,
intersection test, ensure minimal distance, resolve overlaps, cut using
shell, cleanup, (M. Attene)

         )

progressive
meshesimplementation
(H. Hao)

17、(补充)查询每门课程的及格率。

HKS: Computing Heat Kernel
Signature(J.
Sun, M. Ovsjanikov, L. Guibas)

    本题可以分三步做:

SDFGen: generate grid-based signed distance field (level set) from
triangle
meshes(C.
Batty, R. Bridson)

   

mesh_query: robustly checking inside/outside and segment intersection
with a
mesh(R.
Bridson)

    第1步:得到每门课的选修人数

Point Set Processing

     createview  v_all(cno,cnt)

QPoly: meshing scattered 3D
points(Y.
Ohtake)

         as selectcno, count(*) from sc
group by cno

SLIM: sparse low-degree
implicits(fitting,
rendering, reflection lines, analytic curvature measures, crest lines,
suggestive contours) (Y. Ohtake, A. Belyaev, M. Alexa)

    第2步:得到每门课及格人数

Multi-scale Compactly Supported Radial Basis
Functions(Y.
Ohtake)

     createview 
v_pass(cno,cnt_pass)

MeshLab(ICP
range-map alignment, ball pivoting, point-set normals, Robust Implicit
MLS (RIMLS), Algebraic point-set surface (APSS), Poisson surface
reconstruction) [All
Filters]
(Authors)

         as selectcno, count(*) from sc
where grade>=60 group by cno

Vrip(convert
aligned range images to volumetric format, extract mesh surface) (B.
Curless)

   
第3步:每门课的及格人数/每门课选修人数

Zipper(combine
range images into polygonal mesh) (G. Turk, H. Ge, B. Curless)

     selectv_all.cno, cnt_pass*100/cnt 
from  v_all, v_pass

Scanalyze(manual/ICP
alignment and merging of range image data, fill holes, decimation,
editing, PLY/SD formats)
(Authors)

     where v_all.cno = v_pass.cno

QSplat(real-time
multiresolution point-set rendering) (S. Rusinkiewicz, G. King)

 

Constructing Laplace Operator from Point Clouds in
R^d(J.
Sun, M. Belkin, Y. Wang)

18、查询平均分不及格的学生的学号,姓名,平均分。

NormFet: Approximating Normals and Feature Sizes from Noisy Point
Clouds(T.
Dey, J. Sun, L. Molnar)

    Selectsc.sno,sname,avg(grade) from
student,sc

AMLS for Smoothing Noisy Point
Clouds(adaptive
moving least squares) (T. Dey, J. Sun)

    wherestudent.sno=sc.sno

Cocone: Delaunay meshing of point sets with
boundaries(T.
Dey, J. Giesen)

    group bysc.sno,sname

Tight Cocone: water-tight Delaunay meshing of point sets using
approximate medial
axis(T.
Dey, S. Goswami, W. Zhao)

    havingavg(grade)<60

SuperCocone: efficient Delaunay meshing of large point
sets(T.
Dey, J. Hudson)

思考本题也可以用嵌套做吗?

RobustCocone: Delaunay meshing of noisy point
sets(T.
Dey, S. Goswami)

 

Peel: isotropic reconstruction of surfaces from point sets with or
without
boundaries(T.
Dey, K. Li)

19、查询平均分不及格的学生人数。

4-points Congruent Sets for Robust Surface
Registration(D.
Aiger, N. Mitra, D. Cohen-Or)

    Select count(*)from student

CGAL(Poisson
reconstruction, spacing estimation, simplification, outlier removal,
smoothing, normal estimation, orientation estimation)[full packages
list]
(Authors)

    where sno in

integral estimation on a k-manifold embedded in
R-d(C.
Luo, J. Sun, Y. Wang)

         ( selectsno from sc group by sno
having avg(grade)<60 )

discrete Laplace-Beltrami operator on point
clouds[Page]
(C. Luo, I. Safa, Y. Wang)

    下面是一个典型的错误

FReg: detect approximate symmetries of point sets and B-Rep
Models(Authors)

Select count(*) from sc group by sno
havingavg(grade)<60

Normal Improvement for Point
Rendering(bilateral
normal filtering)
[Page]
(T. Jones)

这是每个学生有几门不及格的数目

Reconstruction of Solid Models from Oriented Points
Sets(M.l
Kazhdan)

 

Poisson Surface
Reconstruction(M.
Kazhdan)

三、

Multilevel Streaming for Out-of-Core Surface
Reconstruction(M.
Bolitho, M. Kazhdan, R. Burns, H. Hoppe)

 1、查询工资在1000到3000元之间的男性业务员的姓名和办公室编号。

CUDA-Based implementations of SoftAssign and
EM-ICP(T.
Tamaki, M. Abe, B. Raytchev, K. Kaneda, M. Slomp)

    SelectYname,Ono from YWY

Coherent Point
Drift(rigid,
affine, nonrigid N-D alignment and correspondence) (A. Myronenko)

    where Salarybetween 1000 and 3000 and
Ysex=’男’

PowerCrust(watertight
polygonal meshing of point set, medial axis transform, simplified medial
axis) (N. Amenta) [updated
port]

 2、查询各个办公室的业务员人数,输出办公室编号和对应的人数。

Curves and Surfaces

    SelectOno,count(*) from YWY group by
Ono

A Bidirectional Generating Algorithm for Rational Parametric
Curves(Z.
Li, L. Ma)

 3、查询每个客户在2002年5月购买的总金额,输出客户号和相应的总金额。

Fast Detection of the Geometric Form of Two-Dimensional Cubic Bézier
Curves(S.
Vincent)

    SelectKno,sum(Fmoney) from FP

Exact Evaluation of Subdivision
Surfaces(eigenstructures
for Catmull-Clark and Loop schemes) (J. Stam)

    where Fdatebetween ‘2002.5.1’ and
‘2002.5.31’

Exact Evaluation of Catmull-Clark Subdivision Surfaces near B-Spline
Boundaries(D.
Lacewell, B. Burley)

    group by Kno

Smooth Two-Dimensional Interpolations: A Recipe for All
Polygons(E.
Malsch, J. Lin, G. Dasgupta)

 4、查询2002年5月购买次数超过5次的所有客户号,且按客户号升序排序。 

Normal Patches /
PN-Triangles(R.
Stimpson)

    Select Kno fromFP

Marching
Cubes(.vol
files) (R. Stimpson)

    where Fdatebetween ‘2002.5.1’ and
‘2002.5.31’

Coons
Patches(R.
Stimpson)

    group by Kno

Exact Catmull-Clark Subdivision
evaluation(and
mean-curvature minimization) (F. Hecht)

    havingcount(*)>5

Laplacian Surface
Editing(2D
curve deformation) (O. Sorkine, D. Cohen-Or, Y. Lipman, M. Alexa, C.
Roessl, H.-P. Seidel)

    order by KnoASC

Elasticurves: Exploiting Stroke Dynamics and Inertia for the Real-time
Neatening of Sketched 2D
Curves(Y.
Thiel, K. Singh, R. Balakrishnan)

 5、查询各办公室男性和女性业务员的平均工资。

Computational Geometry

    SelectOno,Ysex,avg(Salary) from YWY
group by Ono,Ysex

2D voronoi diagrams with
CGAL(P.
Alliez)

 6、查询2002年5月曾经在王海亮业务员手中购买过商品的客户号、

TRIANGLE: 2D high-quality exact/constrained/conforming Delaunay
triangulations(J.
Shewchuk)

            客户姓名和联系电话。

Stellar: a tetrahedral mesh improvement
program(B.
Klingner, J. Shewchuk)

    SelectKno,Kname,Phone from KH where
Kno in

TetGen: A
Quality Tetrahedral Mesh Generator and a 3D Delaunay Triangulator
(constrained/conforming Delaunay, Voronoi, boundary-conforming,
quality/size control, adaptive mesh refinement, intersection testing)
(H. Si)

         ( SelectKno from FP

manifold approximation of 3D medial
axis(S.
Yoshizawa)

           whereFdate between ‘2002.5.1’
and ‘2002.5.31’ and Yno in

CGAL(n-D geometry,
2D/3D spherical geometry, n-D convex hull, 2D/3D/spherical booleans, 2D
minkowski sums, 2D polygon partition/offset/skeleton, 2D curve
intersection, 2D/3D envelopes, 2D/3D triangulation, 2D/3D alpha shapes,
2D delaunay/voronoi/apollonius/conforming delaunay/conforming gabriel,
3D delaunay isosurfacing, 3D skin surface, n-D spatial data structures,
bounding volumes, optimal distances, least-squares geometry fitting,
2D/surface function interpolation, kinetic data structures, AABB Tree,
3D periodic triangulations, tetrahedral meshing w/
implicit/volume/polyhedral boundaries) [full packages
list]
(Authors)

                      ( Select Yno from
YWY where Yname=’王海亮’ )

METRO: measure differences between triangular
meshes(Authors)

         )

BOOLEconvert
CSG to Brep (curved solid primitives, polygonal solids) (T. Culver)

    注意本题也可以用连接做

MAPC:
exact manipulation of algebraic points and curves in the plane (D.
Manocha, J. Keyser, T. Culver, M. Foskey, S. Krishnan)

 7、查询所有工资比1538号业务员高的业务员的编号、姓名和工资。

Fast Polygon Triangulation based on Seidel’s
Algorithm(A.
Narkhede, D. Manocha)

    SelectYno,Yname,Salary from YWY where
Salary >

UNC GAMMA Collision Detection/Proximity Query
Packages(penetration
depth, intersection detection, tolerance verification, exact and
approximate distance computation, separation distance, contact
determination, Minkowski sums, Lin-Canny closest features, uniform grid
spatial decomposition, OBB/Swept-Sphere/convex-hull bounding-volume
hierarchies, polygon soups, rigid motion)

         ( SelectSalary from YWY where
Yno=’1538′ )

DeformCD: collision detection for deformable
models(M.
Tang, D. Manocha)

 8、查询所有与1538号业务员在同一个办公室的其他业务员的编号和姓名。

CurveSkel: 1D curve skeleton of 3D
shape(T.
Dey, J. Sun)

    SelectYno,Yname from YWY where
Yno!=’1538′ and Ono in

Shortest paths on a polyhedral
surface(B.
Kaneva, J. O’Rourke)

         ( SelectOno from YWY where
Yno=’1538′ )

Antiprism polyhedra
library(convex
hull, polar reciprocals (dual meshes), geodesic spheres, uniform
polyhedra, uniform tilings on surfaces, lattices and grids, ring/spiral
of points on sphere, equilibrium of points repelling on sphere,
near-uniform sphere tessellation, many other polyhedra types, OFF
conversion utilities) [A. Rossiter]

 9、查询销售总金额最高的业务员的编号。

Nuages3D
delaunay mesh reconstruction from parallel cross-sections (B. Geiger)

    Select Yno fromFP group by Yno having
sum(Fmoney) >=ALL

ShortLoop: computing loops in a shortest homology
basis(O.
Busaryev, T. Dey, J. Sun, Y. Wang)

         ( Selectsum(Fmoney) from FP group
by Yno )

Coordinate Free Geometric
Programming(S.
Mann, N. Litke, T. DeRose)

10、查询所有业务员的编号、姓名、工资以及工资比他高的其他业务员的平均工资。

Calculation of Mappings between one and n-dimensional values using
hilbert space-filling
curve(J.
K. Lawder)

    利用自连接

A Fast and Robust GJK Implementation for Collision Detection of Convex
Objects(G.
van den Bergen)

   
SelectY1.Yno,Y1.Yname,Y1.Salary,avg(Y2.Salary)

Fast Distance Field and Generalized Voronoi Diagram Computation using
Graphics
Hardware(Authors)

    from   YWY Y1, YWY Y2

Efficient Collision Detection of Complex Deformable Models using AABB
Trees(G.
van den Bergen)

    where  Y1.Salary < Y2.Salary

M.E.S.H. : Measuring Error between Surfaces using the Hausdorff
distance(N. Aspert,
D. Santa-Cruz, T. Ebrahimi)

    group by  Y1.Yno  

HandleTunnel: computing handle and tunnel loops on
surfaces(T.
Dey, K. Li, J. Sun)

 

tunicate: robust computational geometry predicates in floating
point(R.
Bridson)

四、

Intersections and Distances

 1、找出每个班级的班级代码、学生人数、平均成绩。

Fast 3D Line Segment—Triangle Intersection
Test(N.
Chirkov)

    SelectBJDM,count(*),avg(CJ) from SC
group by BJDM

An Efficient Ray-Quadrilateral Intersection
Test(A.
Lagae, P Dutre)

 2、找出每个学生的班级代码、学生姓名、考试科目数、总成绩。

On Faster Sphere-Box Overlap
Testing(T.
Larsson, T. Akenine-Moller, E. Lengyel)

    SelectBJDM,XSXM,count(*),sum(CJ) from
SC

Fast Tetrahedron-Tetrahedron Overlap
Algorithm(F.
Ganovelli, F. Ponchio, C. Rocchini)

    group byBJDM,BNXH,XSXM

Ray Bilinear Patch
Intersections(S.
Ramsey, C. Hansen, K. Potter)

 3、输出一张表格,每位学生对应一条记录,包括字段:

GPU-Based Tiled Ray Casting using Depth
Peeling(F.
Bernadon, C. Pagot, J. Comba, C. Silva)

         
班级代码、学生姓名、语文成绩、数学成绩、外语成绩。

An Efficient and Robust ray-box intersection
algorithm(A.
Williams, S. Barrus, R. Morley, P. Shirley)

   
SelectSC1.BJDM,SC1.XSXM,SC1.CJ,SC2.CJ,SC3.CJ

A Fast Triangle-Triangle Intersection
Test(T.
Moller)

    from  SC SC1, SC SC2, SC SC3

Fast and Robust Triangle-Triangle Overlap Test using Orientation
Predicates(P.
Guigue, O. Devillers)

    whereSC1.BJDM=SC2.BJDM and
SC1.BNXH=SC2.BNXH and

A Fast Triangle-Triangle Overlap Test Using Signed
Distances(H.
Shen, Z. Tang)

         SC2.BJDM=SC3.BJDM and
SC2.BNXH=SC3.BNXH and

Fast Ray-Axis Aligned Bounding Box Overlap Tests with Plücker
Coordinates(J.
Mahovsky, B. Wyvill)

          SC1.KM=’语文’ and SC2.KM=’数学’
and SC3.KM=’外语’

Fast Ray/Axis-Aligned Bounding Box Overlap Tests using Ray
Slopes(M.
Eisemann, M. Magnor, T. Grotsch, S. Muller)

 4、输出一张表格,有成绩低于60分的每位学生对应一条记录,包括字段:

Fast, Minimum Storage Ray-Triangle
Intersection(T.
Moller, B. Trumbore)

         
班级代码、学生姓名、最低成绩。

Lightweight Bounding Volumes for Ray
Tracing(D.
Cline, K. Steele, P. Egbert)

    SelectBJDM,XSXM,min(CJ) from SC

Fast and Accurate Circle-Circle and Circle-Line 3D Distance
Computation(D.
Vranek)

    where  CJ<60 group by
BJDM,BNXH,XSXM

A Shaft Culling
Tool(E.
Haines)

    或:  SelectBJDM,XSXM,min(CJ) from
SC

Fast 3D Triangle-Box Overlap
Testing(T.
Akenine-Moller)

          group byBJDM,BNXH,XSXM

Intersection Test for Collision Detection in Particle
Systems(E.-A.
Karabassi, G. Papaioannou, T. Theoharis, A. Boehm)

          havingmin(CJ)<60

Techniques for Interactive Ray Tracing of Bézier
Surfaces(C.
Benthin, I. Wald, P. Slusallek)

 5、输出一张表格,有成绩低于60分的每位学生对应一条记录,包括字段:

Photorealistic Rendering

         
班级代码、学生姓名、最高成绩、平均成绩。

TAGL: software
rasterizer(B.
Levy)

    SelectBJDM,XSXM,max(CJ) from SC

ShadeVis: compute per-vertex ambient occlusion
term(Authors)

    group byBJDM,BNXH,XSXM

MeshLab(vertex/face
ambient occlusion)
(Authors)

    havingmin(CJ)<60

LumosQuad(2D
lighting simulation and rendering, quadtree conjugate gradient Poisson
solver) (T. Kim, M. Lin)

    请思考下列做法是否正确:

OpenEXR(read/write/view
OpenEXR HDR images)

          SelectBJDM,XSXM,max(CJ),avg(CJ)
from SC

bv(BRDF
browser, many analytic and empirical BRDF included) (S. Rusinkiewicz)

         where  CJ<60 group
byBJDM,BNXH,XSXM

LightPack(light
field authoring and rendering)

 6、输出一张表格,所有成绩都不低于60分的每位学生对应一条记录,包括字段:

aperture(light-field
viewer)

         
班级代码、学生姓名、平均成绩。

renderman shader to dump out
grids(M.
Pharr)

    SelectBJDM,XSXM,avg(CJ) from SC

skin
shader(M.
Pharr)

    group by BJDM,BNXH,XSXM

raytracing quaternion julia sets on the
GPU(K.
Crane)

Author

发表评论

电子邮件地址不会被公开。 必填项已用*标注