Closed johnroper100 closed 8 years ago
https://github.com/johnroper100/CrowdMaster/blob/master/simulation/main.py#L59-L63
randRot = random.uniform(0, scene.randomPositionMaxRot)
eul = mathutils.Euler((0.0, 0.0, 0.0), 'XYZ')
eul.rotate_axis('Z', math.radians(randRot))
See that?
I will tell you when I have moved the code to it's proper place so that work can be done.
The code for the random rotation is https://github.com/johnroper100/CrowdMaster/blob/master/cm_agent_generation/generation.py#L36-L39
randRot = random.uniform(0, scene.randomPositionMaxRot)
eul = mathutils.Euler((0.0, 0.0, 0.0), 'XYZ')
eul.rotate_axis('Z', math.radians(randRot))
scene.update()
Rotation is being applied now but not very much control over it. It would be nice to have x, y, z offset, min and max rotation.
Ok, that can be done. This was just the first step.
Currently, there is a random rotation value. This does not seem to work for some reason and I have gone through multiple different revisions of code. You can see what I mean if you open the test scene and just press Run Sim. The random rotation and the actions should already be set up. @niewinny @theduckcow Could one of you take a look at this?