NeHe OpenGL Lesson25 – Morphing & Loading Objects From A File

本文探讨了顶点变形技术及其在动画制作中的应用,包括从文本文件加载对象的方法。顶点变形允许平滑地将一个对象转换为另一个,如人类到车辆的转变。然而,这种技术内存消耗大,已被皮肤动画所取代,后者使用GPU进行皮肤计算,显著提升速度。文章还讨论了使用文本文件作为游戏开发过程中的内容组织方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

screen_shot7-300x223 This sample shows us how to do vertex morphing and load objects from text files.
For vertex morphing, you could apply such technology to transform smoothly object A to object B, like transform a human being to a vehicle and so on. Actually, this is an old animation technology. As you see, we need to keep a whole vertex posture for each key frame. This will take a lots of memory space. So currently, such animation technology already replaced by the skin animation which use only one copy of the vertex data and those key frames data saved into the bones. And we also apply skin calculation on the GPU, this will improve the speed a lots. But vertex morphing still has it’s space, like transform one object to another one, because such transform data is very hard to convert into skin animation.

 

Vertex Morph Implementation

To morph, the vertex number of those two objects should be the same. That means, we need to do one vertex to one vertex mapping. For each vertex, we could do the following calculation to transform source object to destination object:
D = S – (S – D) / steps;
After the ‘steps’ steps later, we could find the right part (immediate part, or morphing part) fully equal to the left part (Destination). Then we get a D from S. That is it. This is all done by this sample.

 

Something More

Another topic mentioned here is that loading objects from text file. For some assets, like model vertex, animation saved as text is not a good idea. String parsing  will take a lots of time, make them binarized should be much better. But we could still use text file, such as .xml file during the process of game development. We could use .xml to organize the scene structure, contain the map or level content, make a simple description of a special material or shader graph and so on. We could use text files as an immediate content, but should use it as the final asset format. Of course, you could use text file as configure file.


For more details, you could find the source code from here.

转载于:https://www.cnblogs.com/open-coder/archive/2012/08/23/2653274.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值