1
$\begingroup$

I have a script that creates a bunch of object and I would like to rotate them around a global point ( (0, 0, 0) at the moment but I'll need to do this with different points). I was unable to find anything about rotating around a point.

$\endgroup$
1

1 Answer 1

2
$\begingroup$

Things to look at. 1) simple script

import bpy
import math

R = 10
start_pos = (R,0,0)

ob = bpy.data.objects["Cube"]

for frame_num in range(1,101):
    angle = 2*math.pi*frame_num/100.0
    x = R*math.cos( angle)
    y = R*math.sin( angle)
    z = 0
    bpy.context.scene.frame_set(frame_num)
    ob.location=(x,y,z)
    ob.keyframe_insert(data_path="location", index = -1)

2) place an empty at the point around which you wish to rotate, and make that parent --- see Olav3D's https://www.youtube.com/watch?v=nmLjYSmaW48

3) understand Euler rotations and their limitations

4) For 'Rolls Royce' rotation --- study quaternions.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .