游戏开发论坛

 找回密码
 立即注册
搜索
12
返回列表 发新帖
楼主: lizelglg

难道学3D游戏开发就必须学四元数吗?

[复制链接]

0

主题

228

帖子

285

积分

中级会员

Rank: 3Rank: 3

积分
285
发表于 2007-5-31 16:29:00 | 显示全部楼层

Re:难道学3D游戏开发就必须学四元数吗?

楼上说的对
就冲着可以解决万向节锁和提供平滑的插值就很值得学了

42

主题

115

帖子

141

积分

注册会员

Rank: 2

积分
141
 楼主| 发表于 2007-6-3 23:05:00 | 显示全部楼层

Re:难道学3D游戏开发就必须学四元数吗?

那请问那里有这方面的资料呢?拜托发个网站连接给我吧,我下跪了,我给你们磕头了

64

主题

272

帖子

272

积分

中级会员

Rank: 3Rank: 3

积分
272
发表于 2007-6-4 09:40:00 | 显示全部楼层

Re:难道学3D游戏开发就必须学四元数吗?

这个叫四元数吗??????
我大一时候学的线性代数啊(当时不知道线性代数有甚么用,学的普普通通),现在刚在学DX,看这些也蛮轻松的。(当然不敢说后面也这么轻松,像这些矩阵转换还是明白为什么的)

42

主题

115

帖子

141

积分

注册会员

Rank: 2

积分
141
 楼主| 发表于 2007-6-4 11:34:00 | 显示全部楼层

Re:难道学3D游戏开发就必须学四元数吗?

我看书上说的二元数貌似是从虚数推广的,四元数是从二元数推广的,但连它如何推理出来的都不知道

2

主题

24

帖子

24

积分

注册会员

Rank: 2

积分
24
发表于 2007-6-4 13:40:00 | 显示全部楼层

Re:难道学3D游戏开发就必须学四元数吗?


  1. Okay, Quaternions was introduced by Hamilton as a noncommutative parallel to the complex numbers.

  2. What do we mean by noncommutative parallel to the complex number?

  3. First, let's define the complex numbers.

  4. Suppose we endow R^2 with a multiplication by:

  5. (a,b)(c,d) = (ac-bd,bc+ad).

  6. Under this definition R^2 becomes a field, let's call this field C. This is the complex numbers.
  7. Notice that, (a,b)*(a/(a^2+b^2),-b/(a^2+b^2)) = e, where e is the identity element, (1,0). That is, nonzero elements of R form an abelian group under multiplication.

  8. WE denote (0,1) by i, and identity x in R by (x,0), so R is a subset of C.

  9. Thus, (a,b) = a + ib, a,b in R. i^2 = -1.

  10. C is generated by adjoining i to R and closing under addition and multiplication.

  11. Complex division:

  12. Let z = a+ib, w = c+id

  13. Then,

  14. a + ib      a+ib (c-id)     ac+bd+i(bc-ad)
  15. ------  =  ------------  = ----------------
  16. c + id    c +id  (c-id)     c^2 + d^2

  17. Now, let z^bar = a-bi, z^2 = (a + ib)(a-ib) = a^2 + b^2
  18. z^-1 = z^bar / z^2

  19. That is, z^1 = (a-bi)/(a^2+b^2)

  20. --------------------------
  21. The Euler identity:

  22. e^it = cos(t) + isin(t),

  23. Complex polar form:

  24. z = a + bi = r*e^it

  25. Now, for quaternions (we shall see that quaternions is very similar to the complex numbers, with the exception that it is noncommuicative.):

  26. Let F be the field of real numbers and consider the set of
  27. a0 + a1*i + a2*j + a3*k, where a0,a1,a2,a3 in F.

  28. Now, suppose we define

  29. i^2 = j^2 = k^2 = -1
  30. ij = k, ki = j, ji = -k, kj = -i, ik = -j.

  31. (a0 + a1*i + a2*j + a3*k)(b0 + b1*i + b2*j + b3*k)

  32. Multiply like you do using the distributive laws but using the product rules for i,j,k defined above.

  33. Okay, like C, we can define a multiplicative inverse.

  34. Suppose q = s + v, where s = a0, v = a1*i + a2*j + a3*k
  35. q^bar = s - v
  36. q^2 = q*q^bar = q^bar*q = q*q = q^2

  37. Notice this is parallel to the complex numbers.

  38. Now we can define a parallel to z^-1, that is,

  39. q^-1 = q^bar/q^2.

复制代码


我累了,明天在说吧。。。还要证明!!!




2

主题

24

帖子

24

积分

注册会员

Rank: 2

积分
24
发表于 2007-6-5 11:50:00 | 显示全部楼层

Re:难道学3D游戏开发就必须学四元数吗?

hmmmm

对不住啦!我学数学的,我用字可能太专业了,太他妈的蛋逼了...

我用quaternion都事interpolating rotations. 我还用它搞了之个东西,http://www.cs.indiana.edu/pub/techreports/TR407.pdf

一般你要搞3D graphics我觉得你要高懂quaternions.是个很平常的东西...

若果你还要的话我可以continue...

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-26 05:40

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表