Metasequoia BBS

| New message | Normal | Tree |
Status
Tag
Keyword
[9772] If create a cube using script, texture mapping isn't work / tga
[Question] Response
def unitcube(x=0,y=0,z=0):
 obj= MQSystem.newObject()
 num=doc.numObject
 a=num
 obj.name="cube_%d" % a
 obj.addVertex(x-1/2.0,y-1/2.0,z+1/2.0)
 obj.addVertex(x+1/2.0,y-1/2.0,z+1/2.0)
 obj.addVertex(x+1/2.0,y+1/2.0,z+1/2.0)
 obj.addVertex(x-1/2.0,y+1/2.0,z+1/2.0)
 obj.addVertex(x-1/2.0,y-1/2.0,z-1/2.0)
 obj.addVertex(x-1/2.0,y+1/2.0,z-1/2.0)
 obj.addVertex(x+1/2.0,y+1/2.0,z-1/2.0)
 obj.addVertex(x+1/2.0,y-1/2.0,z-1/2.0)
 obj.addFace([0,3,2,1])
 obj.addFace([1,2,6,7])
 obj.addFace([4,7,6,5])
 obj.addFace([0,4,5,3])
 obj.addFace([3,5,6,2])
 obj.addFace([0,1,7,4])


Show more...
2023-07-20 01:48
[9773] Re: If create a cube using script, texture mapping isn't work / tga
Is the cube created by script a normal cube sane as the cube created by primitive tool?
How could I using script to create a cube same as cube created by primitive tool?
2023-07-20 02:49
[9774] Re: If create a cube using script, texture mapping isn't work / tga
problem solved,you need to add new coord to each face of the cube
2023-07-20 07:10