From: Amit C. <am...@sd...> - 2004-08-31 22:28:33
|
Hello Folks, I am trying to make triangles using cgo objects Here is the code, this does not work ********************************* from pymol.cgo import * from pymol import cmd obj =3D [] obj.extend( [ TRIANGLE, 0.0, 0.0, 0.0, #vertex 1 1.0, 0.0, 0.0, #vertex 2 0.0, 0.0, 1.0, #vertex 3 0,1,0, #normal 1 0,1,0, #normal 2 0,1,0, #normal 3 1,1,1, #color vertex 1 1,1,1, #color vertex 2 1,1,1, #color vertex 3=09 ] ) cmd.load_cgo(obj,'my_triangle') *********************************** But this one works ************************* obj=3D[BEGIN, TRIANGLES, =20 VERTEX, 0.0, 0.0, 0.0, VERTEX, 4,4,4, VERTEX, 0.0, 0.0, 2.0, END ] cmd.load_cgo(obj,'my_tri') ******************************* I looked into cgo.h, cgo.c and manual it seemed vertices,normals and colors is all that's needed for triangles Please let me know what is missing/wrong. Thanks for your time. Regards --Amit PS: Chris your normalization code will come in handy when I get this thing to work properly. Thanks! |