show | version | enable_checker |
---|---|---|
step |
1.0 |
true |
- 上次我们研究了
- 物体的旋转
- 有三个轴向
英文 | 中文 | 作用 |
---|---|---|
heading | 航向轴 | 转头 |
pitch | 俯仰轴 | 点头 |
bank | 横滚 | 歪头 盗梦空间特效 |
- 可以让飞机排成一个阵列吗?
import bpy
from math import pi
bpy.ops.object.select_all(action="SELECT") # 选择所有物体
bpy.ops.object.delete() # 删除选定的物体
planes = []
for n in range(5):
c919 = bpy.data.objects.new("c919", None)
bpy.data.collections["Collection"].objects.link(c919)
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=9)
bpy.context.object.rotation_euler[0] = pi /2
bpy.context.object.parent = c919
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.name = "body"
bpy.context.object.scale = (0.2,0.75,1)
bpy.context.object.parent = c919
bpy.context.object.rotation_euler[0] = - pi / 4
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail1"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (1,0.5,0.25)
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail2"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (5,1,0.25)
bpy.context.object.location = (0, -1 ,0)
bpy.context.object.parent = c919
bpy.context.object.name = "wings"
c919.location[0] = 10 * n
planes.append(c919)
- 效果
- 可以拍成一字长蛇阵吗?
c919.location[1] = 10 * n
- 结果
- 如果location选择第2个列表项
- 会如何呢?
c919.location[2] = 10 * n
- 结果
- 可以把飞机列成一个方阵吗?
bpy.ops.object.delete() # 删除选定的物体
planes = []
for n1 in range(5):
for n2 in range(5):
c919 = bpy.data.objects.new("c919", None)
bpy.data.collections["Collection"].objects.link(c919)
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=9)
bpy.context.object.rotation_euler[0] = pi /2
bpy.context.object.parent = c919
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.name = "body"
bpy.context.object.scale = (0.2,0.75,1)
bpy.context.object.parent = c919
bpy.context.object.rotation_euler[0] = - pi / 4
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail1"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (1,0.5,0.25)
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail2"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (5,1,0.25)
bpy.context.object.location = (0, -1 ,0)
bpy.context.object.parent = c919
bpy.context.object.name = "wings"
c919.location[0] = 10 * n1
c919.location[1] = 10 * n2
planes.append(c919)
- 效果
- 可以将方阵纵向叠加吗?
import bpy
from math import pi
bpy.ops.object.select_all(action="SELECT") # 选择所有物体
bpy.ops.object.delete() # 删除选定的物体
planes = []
for n1 in range(5):
for n2 in range(5):
for n3 in range(5):
c919 = bpy.data.objects.new("c919", None)
bpy.data.collections["Collection"].objects.link(c919)
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=9)
bpy.context.object.rotation_euler[0] = pi /2
bpy.context.object.parent = c919
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.name = "body"
bpy.context.object.scale = (0.2,0.75,1)
bpy.context.object.parent = c919
bpy.context.object.rotation_euler[0] = - pi / 4
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail1"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (1,0.5,0.25)
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail2"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (5,1,0.25)
bpy.context.object.location = (0, -1 ,0)
bpy.context.object.parent = c919
bpy.context.object.name = "wings"
c919.location[0] = 10 * n1
c919.location[1] = 10 * n2
c919.location[2] = 10 * n3
planes.append(c919)
- 919列阵
- 可以列出什么阵型吗?
import bpy
from math import pi
bpy.ops.object.select_all(action="SELECT") # 选择所有物体
bpy.ops.object.delete() # 删除选定的物体
planes = []
for n1 in range(5):
for n2 in range(n1+1):
c919 = bpy.data.objects.new("c919", None)
bpy.data.collections["Collection"].objects.link(c919)
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=9)
bpy.context.object.rotation_euler[0] = pi /2
bpy.context.object.parent = c919
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.name = "body"
bpy.context.object.scale = (0.2,0.75,1)
bpy.context.object.parent = c919
bpy.context.object.rotation_euler[0] = - pi / 4
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail1"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (1,0.5,0.25)
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail2"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (5,1,0.25)
bpy.context.object.location = (0, -1 ,0)
bpy.context.object.parent = c919
bpy.context.object.name = "wings"
c919.location[0] = -10 * n1
c919.location[1] = -10 * n2
planes.append(c919)
- 锋芒所指
- 无坚不摧
import bpy
from math import pi
bpy.ops.object.select_all(action="SELECT") # 选择所有物体
bpy.ops.object.delete() # 删除选定的物体
planes = []
for n1 in range(5):
for n2 in range(n1+1):
c919 = bpy.data.objects.new("c919", None)
bpy.data.collections["Collection"].objects.link(c919)
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=9)
bpy.context.object.rotation_euler[0] = pi /2
bpy.context.object.parent = c919
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.name = "body"
bpy.context.object.scale = (0.2,0.75,1)
bpy.context.object.parent = c919
bpy.context.object.rotation_euler[0] = - pi / 4
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail1"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (1,0.5,0.25)
bpy.context.object.location = (0, 5 ,1)
bpy.context.object.parent = c919
bpy.context.object.name = "tail2"
bpy.ops.mesh.primitive_cube_add(size=2)
bpy.context.object.scale = (5,1,0.25)
bpy.context.object.location = (0, -1 ,0)
bpy.context.object.parent = c919
bpy.context.object.name = "wings"
c919.location[0] = -10 * n1 + 5 * n2
c919.location[1] = -10 * n2
planes.append(c919)
- 中锋
- 冲锋陷阵
- 还可以学习什么古阵法吗?
- 古代阵型
-
这次做了很多c919
- 每个飞机都有自己的机身、机翼...
-
如何修改物体的颜色呢?🤔
- 我们下次再说!👋