0
How to create 3d objects using python
please help I am trying to mod a game and create new objects map players etc so if anyone knows help me
3 Answers
0
Once you have got the data from the file (for this Regular Expressions are applicable), you will want to input that into a class which is defined as to store the two points (which can be objects themselves) e.g.
class Point(tuple):
@property
def x:
return self[0]
@property
def y:
return self[1]
@property
def z:
return self[2]
class Vector(object):
def __init__(self, x1, y1, z1, x2, y2, z2):
self._a = Point(x1, y1, z1)
self._b = Point(x2, y2, z2)
@property
def a(self):
return self._a
@property
def b(self):
return self._b
# Other methods here e.g.
@property
def i(self):
return self.b.x - self.a.x
@property
def j(self):
return self.b.y - self.a.y
@property
def k(self):
return self.b.z - self.a.z
def length(self):
return ( self.i**2 + self.j**2 + self.k**2 ) ** (1/2)
0
i didn't understand it properly
0
Wow i did in HTML but this python kind of crazy... help IF U KNOWN PLS SHARE