|
Size: 646
Comment:
|
Size: 648
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 13: | Line 13: |
| Line 17: | Line 17: |
| NodePath.setHpr(H,P,R) #旋转 | NodePath.setHpr(H,P,R) #旋转 |
| Line 23: | Line 23: |
| Heading: XZ平面逆时针转 | * Heading: XZ平面逆时针转 |
| Line 25: | Line 25: |
| Pitch: YZ平面 | * Pitch: YZ平面 |
| Line 27: | Line 27: |
| Roll: | * Roll: |
| Line 29: | Line 29: |
| 旋转的例子: attachment:hpr.py 使用simples/tutorial1中的model | 旋转的例子: attachment:hprtest.py 使用simples/tutorial1中的model |
基础
组成结构
- 树型结构
Render -> NodePath -> PandaNode(Geom) [GeomVertexData, GeomPrimitive]
GeomVertexData 保存顶点数据, GeomPrimitive 保存顶点的index
坐标
- render(3d) X右,Y前,Z上 render2d 坐标左下角(-1,0,-1)到右上角(1,0,1)
移动、形变
NodePath.setPos(X,Y,Z) #位移
NodePath.setHpr(H,P,R) #旋转
NodePath.setScale(uniform) #缩放
- 旋转方向
- Heading: XZ平面逆时针转
- Pitch: YZ平面
- Roll:
镜头
- base.camera
