如何操作物体在3D空间中的位置呢,方法有很多。
这里总结一下最流行的矩阵操作。
1. 放大缩小一个物体,我们可以填写一个放大缩小矩阵,如下代码:
void InitScaleTransform(Matrix4f& m) const
{
m.m[0][0] = m_scale.x; m.m[0][1] = 0.0f ; m.m[0][2] = 0.0f ; m.m[0]...
分类:
其他好文 时间:
2014-06-08 16:50:46
阅读次数:
265
std::string CStringToSTDStr(const CString& theCStr)
{
// Convert the CString to a regular char array
const int theCStrLen = theCStr.GetLength();
char *buffer = (char*)malloc(sizeof(char)*(theCStrLe...
分类:
其他好文 时间:
2014-06-08 16:33:53
阅读次数:
218
给出一段数据,然后要更新单个数据,会询问一段数据中的最大值。
又是一道分段树操作。渐渐熟手了。
#pragma once
#include
#include
using namespace std;
class IHateIt_1754_1
{
static const int SIZE = 200001;
int *segTree; //不要使用segTree[SIZE<<2]...
分类:
其他好文 时间:
2014-06-08 15:40:21
阅读次数:
208
题目来源:Light OJ 1278 Sum of Consecutive Integers
题意:N拆分成连续整数和的方案数
思路:奇因数的个数
#include
#include
#include
#include
using namespace std;
//筛素数
const int maxn = 10000010;
bool vis[maxn];
int prime[10...
分类:
其他好文 时间:
2014-06-08 15:34:09
阅读次数:
295
今天,不容易弄到一个xcode 6,装上之后感受一把Swift。
Hello World
新建一个工程,看看久违的Hello World
变量与常量
在Swift中变量声明用var,常量的声明用let。
这里和oc和c还是有不一样的地方。
判断
switch
case 4:
case 5:println("5") 会报错...
分类:
其他好文 时间:
2014-06-08 14:51:05
阅读次数:
248
Problem Description
Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:
1. Emergenc...
分类:
其他好文 时间:
2014-06-08 10:31:22
阅读次数:
234
题意:贪吃蛇的题目
思路:BFS+状态的记录,坑了无数发,#include
#include
#include
using namespace std;
const int MAXN = 500000;
bool flag[8],vis[25][25],mp[21][21][16384];
int n,m,l;
int xx[4]={-1,0,1,0}; // up,right,dow,left...
分类:
其他好文 时间:
2014-06-08 10:13:19
阅读次数:
204
Definition
Let be "0" and
be "01". Now (the concatenation of the previous sequence and the one before that).
The infinite Fibonacci word is the limit
We have:
0
01
010
01...
分类:
其他好文 时间:
2014-06-08 09:19:42
阅读次数:
273
点击打开链接
两次求最短路(第二次把边反向求)
1、spfa
//poj 3268 Silver Cow Party
//SPFA
#include
#include
#include
using namespace std;
const int M = 100000 + 100;
const int N = 1000 + 100;
const int inf = 1...
分类:
其他好文 时间:
2014-06-08 05:29:39
阅读次数:
241
http://poj.org/problem?id=1286
题意:有红、绿、蓝三种颜色的n个珠子,要把它们构成一个项链,问有多少种不同的方法。旋转和翻转后相同的属于同一种方法。
polya计数。
搜了一篇论文Pólya原理及其应用看了看polya到底是什么东东,它主要计算全部互异的组合的个数。对置换群还是似懂略懂。用polya定理解决问题的关键是找出置换群的个数及哪些置换群...
分类:
其他好文 时间:
2014-06-08 03:19:16
阅读次数:
250