游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1670|回复: 4

我在读Advanced Animation with DirectX 有问题求教

[复制链接]

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
发表于 2006-12-21 23:16:00 | 显示全部楼层 |阅读模式
我想请教一个问题,我读这本书到第7章了,前6章像是在肯硬骨头,都挺过来了,而且也都用9.0c重写了一边,真不容易啊。这真是一本难得的好书


这章主要实现的是bounding box 来做 rigid bodies 做碰撞检测和骨骼计算,感觉有了这章内容,才能把骨骼的技术发挥到及至,非常的吸引人,其中涉及到了不少数学和物理知识,真是有点让人费解,有个地方我实在想不明白。

我读到7章144(第 151/353 页)就卡住了
...
So, using the two forces that were combined into one, you can linearly move your rigid body by directly
applying the force to the body's position vector. Suppose that a rigid body's position is stored in a vector
called vecPosition.
// Add force vector to position vector
vecPosition += vecForce;

为什么要把rigid bodies 的中心位置去加上力向量?
力向量+力向量=合成力向量  可是 位置向量+力向量得到的东西有什么实际意义?

我不明白,忘看过这章的人能指点一二,谈谈里面的思路,这章内容太精彩了,花再多的时间我也想要坚持把它搞懂

9

主题

688

帖子

688

积分

高级会员

Rank: 4

积分
688
发表于 2006-12-21 23:17:00 | 显示全部楼层

Re:我在读Advanced Animation with DirectX 有问题求教

这本书哪里有卖?

9

主题

688

帖子

688

积分

高级会员

Rank: 4

积分
688
发表于 2006-12-21 23:21:00 | 显示全部楼层

Re:我在读Advanced Animation with DirectX 有问题求教

大概是说s=s0+at=s0+(F/m)t=s0+F*a(其中a=t/m)
若a=1,则s=s0+F;
胡乱猜想,勿信。

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
 楼主| 发表于 2006-12-21 23:31:00 | 显示全部楼层

Re:我在读Advanced Animation with DirectX 有问题求教

好像有点道理,这本书我是在驴子里面下的,还有源代码,很不错,只是老了一点,在9.0b下能运行,换9.0c就不行了,看了还是要重写的。很痛苦

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
 楼主| 发表于 2006-12-21 23:46:00 | 显示全部楼层

Re:我在读Advanced Animation with DirectX 有问题求教

哦。。。我书没往下看,后面一页就有补充说明了。
Also, you need to factor in time again (also stored as a floating−point variable, Time), which states how
much velocity has built up over a period of time (measured in seconds) and how much velocity has been
applied to the position of the body.
// vecVelocity = D3DXVECTOR3 object
// Mass = float variable
// vecForce = D3DXVECTOR3 object w/force to apply
// Scale force (which represents acceleration) by mass
// and add directly to velocity
vecVelocity += Time * (vecForce / Mass);
// Add velocity to position
vecPosition += Time * vecVelocity;

我太性急了,呵呵。。。就说嘛,这样才合理
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-26 03:13

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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