def randomVectorOnUnitRadiusXZDisk(self): """ Returns a position randomly distributed on a disk of unit radius on the XZ (Y=0) plane, centered at the origin. Orientation will be random and length will range between 0 and 1 """ v = vec3() while 1: v.set( ((frandom01()*2) - 1, 0, (frandom01()*2) - 1)) if (v.length()>=1): break return v
def randomVectorOnUnitRadiusXZDisk(self): """ Returns a position randomly distributed on a disk of unit radius on the XZ (Y=0) plane, centered at the origin. Orientation will be random and length will range between 0 and 1 """ v = vec3() while 1: v.set(((frandom01() * 2) - 1, 0, (frandom01() * 2) - 1)) if (v.length() >= 1): break return v
def RandomVectorInUnitRadiusSphere(self): """ Returns a position randomly distributed inside a sphere of unit radius centered at the origin. Orientation will be random and length will range between 0 and 1 """ v = vec3() while 1: v.set((frandom01() * 2) - 1, (frandom01() * 2) - 1, (frandom01() * 2) - 1) if (v.length() >= 1): break return v
def RandomVectorInUnitRadiusSphere(self): """ Returns a position randomly distributed inside a sphere of unit radius centered at the origin. Orientation will be random and length will range between 0 and 1 """ v = vec3() while 1: v.set ( (frandom01()*2) - 1, (frandom01()*2) - 1, (frandom01()*2) - 1) if (v.length()>=1): break return v