以编程方式制作搅拌机模型的动画从哪里开始?
我必须创建一个简单的 3D 演示。
在 Blender 中有一个模型,我将编写一个 python 程序,它将:
- 构建一个场景,设置相机,绘制一个无限平面,用纹理填充它
- 加载一个模型(从 Blender 导出)并定位对象
- 手柄按键以生成对象我
需要一个涵盖以下 3 点的描述性教程的链接:
- 从 Python 程序创建 3D 场景 从
- 文件加载模型(当然我可以使用任何格式,只是让您知道源是在 Blender 中创建的) )
- 捕获按键
不需要物理或设计方面的帮助,只需主要的程序部分。
谢谢!
I have to create a simplistic 3D demo.
Having a model in Blender, I will write a python program that will:
- build a scene, set camera, draw an infinite plane, fill it with texture
- load a model (exported from Blender) and position the object
- handle key presses to produce the object moves
I need a link to descriptive tutorial(s) covering these 3 points:
- creating a 3d scene from Python program
- loading model from the file (of course I'm fine with any format, just letting you know that the source is created in Blender)
- catching key presses
No need in help on physics, or designing, only the principal programmatic part.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没什么好说的: OpenGL / Glut
另外,请查看 OpenGL 红皮书。您可以在线阅读。
示例是用 C 编写的,但可以轻松移植到 python,因为函数调用是一样的。
至于加载搅拌机模型,请看一下:
使用 python 加载波前 obj 文件
简而言之,查找:
Not much to say: OpenGL / Glut
Also, take a look at the OpenGL red book. You can read it online.
Samples are written in C, but can be easily ported to python, since function calls are the same.
As for loading the blender model, take a look at this:
Loading wavefront obj files with python
In a nutshell look for:
要将组件从另一个 Blender 文件链接到场景中,您可以使用 Python API。
您可以在以下位置找到所有文档:
http://www.blender.org/documentation/blender_python_api_2_59_0/contents.html
特别是,您可能需要:
bpy.data.libraries.load ( http://www.blender.org/documentation/blender_python_api_2_59_0/bpy.types.BlendDataLibraries.html#bpy.types.BlendDataLibraries )检查文件的内容,以及 bpy.ops .wm.link_append(http://www.blender.org/documentation/blender_python_api_2_59_0/bpy.ops.wm .html )从指定文件导入您需要的对象。
我只知道如何在运行游戏引擎时捕获按键。这就是您要找的吗?
干杯
To link components from another Blender file into your scene, you can use the Python API.
You can find all the documentation at:
http://www.blender.org/documentation/blender_python_api_2_59_0/contents.html
In particular, you probably will need:
bpy.data.libraries.load ( http://www.blender.org/documentation/blender_python_api_2_59_0/bpy.types.BlendDataLibraries.html#bpy.types.BlendDataLibraries ) to inspect the contents of a file, and bpy.ops.wm.link_append ( http://www.blender.org/documentation/blender_python_api_2_59_0/bpy.ops.wm.html ) to import the objects you need from the specified file.
I only know how to catch keypresses while running the Game Engine. Is that what you are looking for?
Cheers