On 04/07/2014 at 00:35, xxxxxxxx wrote:
Hi,
I want to place an Object on a given global Koordinate.
What i have is a Matrix with 16 Values like:
"1,0,0,0,0,1,0,0,0,0,1,0,0,0,5,1.439"
I read the documentation and found in the Topic "Matrix Fundamentals"
that my matix is like this:
1 0 0 0 1 0 0 0
v0.x v1.x v2.x v3.x 0 1 0 0
m = v0.y v1.y v2.y v3.y = 0 0 1 0
v0.z v1.z v2.z V3.z 0 0 1 1.439
Here my question:
How can I convert my Data-Structure so, that i can write it in the command
obj.SetMg(Matrix)
here my aktual code
coord = LINEDATA.split(",")
#print coord
#print ("Datenzeile enthält " + str(len (coord)) + " Datensätze")
MA1 = float(coord[0])
MA2 = float(coord[1])
MA3 = float(coord[2])
MA4 = float(coord[3])
MA5 = float(coord[4])
MA6 = float(coord[5])
MA7 = float(coord[6])
MA8 = float(coord[7])
MA9 = float(coord[8])
MA10 = float(coord[9])
MA11 = float(coord[10])
MA12 = float(coord[11])
MA13 = float(coord[12])
MA14 = float(coord[13])
MA15 = float(coord[14])
MA16 = float(coord[15])
Matrix = [[MA1,MA2,MA3,MA4],[MA5,MA6,MA7,MA8],[MA9,MA10,MA11,MA12],[MA13,MA14,MA15,MA16]]
print Matrix
#c4d.SetPoint(i,c4d.Vector(x,y,z))
obj = c4d.BaseObject(c4d.Onull) # Create new cube
#obj.SetRelPos(c4d.Vector(20)) # Set position of cube
obj.SetMg(Matrix)
doc.InsertObject(obj) # Insert object in document
Thanks a lot