游戏开发论坛

 找回密码
 立即注册
搜索
查看: 5313|回复: 15

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

[复制链接]

42

主题

115

帖子

141

积分

注册会员

Rank: 2

积分
141
发表于 2007-5-25 15:11:00 | 显示全部楼层 |阅读模式
我现在不大明白四元数,能不能不学那个?
如果必须学,哪个网站有相关的教材呢?

106

主题

743

帖子

745

积分

高级会员

Rank: 4

积分
745
QQ
发表于 2007-5-25 17:47:00 | 显示全部楼层

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

没学过,等要用再学。

140

主题

1228

帖子

1233

积分

金牌会员

Rank: 6Rank: 6

积分
1233
QQ
发表于 2007-5-25 20:27:00 | 显示全部楼层

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

数学问题去数学找

201

主题

1437

帖子

1963

积分

金牌会员

Rank: 6Rank: 6

积分
1963
QQ
发表于 2007-5-25 21:23:00 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽

14

主题

118

帖子

118

积分

注册会员

Rank: 2

积分
118
发表于 2007-5-26 23:02:00 | 显示全部楼层

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

1.要用到的都要学
2.不用的一样都不学。
3.假如不知道要不要学,都不学。如果真的是必须的,它自然会以问题的形式出现。

1

主题

33

帖子

33

积分

注册会员

Rank: 2

积分
33
发表于 2007-5-27 11:37:00 | 显示全部楼层

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

四元数是用来表示绕某一个向量进行旋转所用的一个表示方法(x,y,z,rad),前三个量表示一个向量V(x,y,z),后面一个rad表示绕这个向量逆时针旋转rad个角度。

这种说法是由某个爵士提出的……具体叫什么名字,偶忘了

4

主题

45

帖子

45

积分

注册会员

Rank: 2

积分
45
发表于 2007-5-27 18:26:00 | 显示全部楼层

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

四元数并不是一个必须的东西,因为可以有其他的如旋转矩阵,3方向旋转等东西可以替代.
四元数对于存储来说比较节省,但是对于编辑来说是比较麻烦的.
四元数虽然不用深入学,但是要理解也很简单,使用也有微软的函数使用.

1

主题

102

帖子

108

积分

注册会员

Rank: 2

积分
108
QQ
发表于 2007-5-28 00:51:00 | 显示全部楼层

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

不好理解,ms单位四元数可以表示超球面空间的一个点(和6楼的那个有什么联系呢?不过这个应该和宇宙模型有联系)
不深入不行……

不过在原理清楚之前可以硬着头皮用[em7]

Think of a person standing on the surface of a big sphere (like a planet)
From the person’s point of view, they can move in along two orthogonal axes (front/back) and (left/right)
There is no perception of any fixed poles or longitude/latitude, because no matter which direction they face, they always have two orthogonal ways to go
From their point of view, they might as well be moving on a infinite 2D plane, however if they go too far in one direction, they will come back to where they started!

Now extend this concept to moving in the hypersphere of unit quaternions
The person now has three orthogonal directions to go
No matter how they are oriented in this space, they can always go some combination of forward/backward, left/right and up/down
If they go too far in any one direction, they will come back to where they started

Now consider that a person’s location on this hypersphere represents an orientation
Any incremental movement along one of the orthogonal axes in curved space corresponds to an incremental rotation along an axis in real space (distances along the hypersphere correspond to angles in 3D space)
Moving in some arbitrary direction corresponds to rotating around some arbitrary axis
If you move too far in one direction, you come back to where you started (corresponding to rotating 360 degrees around any one axis)
A distance of x along the surface of the hypersphere corresponds to a rotation of angle 2x radians
This means that moving along a 90 degree arc on the hypersphere corresponds to rotating an object by 180 degrees
Traveling 180 degrees corresponds to a 360 degree rotation, thus getting you back to where you started
This implies that q and -q correspond to the same orientation
Consider what would happen if this was not the case, and if 180 degrees along the hypersphere corresponded to a 180 degree rotation
This would mean that there is exactly one orientation that is 180 opposite to a reference orientation
In reality, there is a continuum of possible orientations that are 180 away from a reference
They can be found on the equator relative to any point on the hypersphere
Also consider what happens if you rotate a book 180 around x, then 180 around y, and then 180 around z
You end up back where you started
This corresponds to traveling along a triangle on the hypersphere where each edge is a 90 degree arc, orthogonal to each other edge

52

主题

637

帖子

1420

积分

金牌会员

Rank: 6Rank: 6

积分
1420
发表于 2007-5-28 11:58:00 | 显示全部楼层

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

四元数不仅仅是内存省,最主要是运算速度快。其实四元数本身挺简单的,跟vector4差不多。

唯一麻烦的就是四元数和旋转矩阵之间的变换,

其实这里也就一函数,不长,实在实在不懂了,只要会copy就行。

30

主题

357

帖子

388

积分

中级会员

Rank: 3Rank: 3

积分
388
QQ
发表于 2007-5-29 18:46:00 | 显示全部楼层

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

连四元数都怕了???那你还能学会什么啊?日后的困难多着呢,不要以为游戏开发很简单了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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