The pyramid Object
The pyramid object has a rectangular cross section and tapers to a point. The following statement will display a pyramid with the center of the rectangular base at (5,2,0), pointing parallel to the x axis with a base that is 6 high (in y), 4 wide (in z), and with a length 12 from base to tip:
pyramid(pos=(5,2,0), size=(12,6,4))
The pyramid object has the following attributes and default values, like those for cylinders: pos which is the center of the rectangular base (0,0,0), x (0), y(0), z(0), axis (1,0,0), length (1), color (1,1,1) which is color.white, red (1), green (1), blue (1), and up (0,1,0). Additional pyramid attributes:
height In the y direction in the simple case, default is 1
width In the z direction in the simple case, default is 1
size (length, height, width), default is (1,1,1)
mypyramid.size=(20,10,12) sets length=20, height=10, width=12
Note that the pos attribute for cylinder, arrow, cone, and pyramid corresponds to one end of the object, whereas for a box, sphere, or ring it corresponds to the center of the object.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\comphy>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> from visual import *
>>> pyramid(pos=(5,2,0), size = (12,6,4))
<visual.primitives.pyramid object at 0x092CE840>
>>> pyramid(pos=(0,0,0), size = (1,1,1), color = (10,2,8))
<visual.primitives.pyramid object at 0x092CE7E0>
>>> pyramid(pos=(2,4,5), size = (5,14,7), color = (0,4,2))
<visual.primitives.pyramid object at 0x092CE870>
>>>
'기본 카테고리' 카테고리의 다른 글
[경영바이블] p18 모든 조직은 변화해야 한다. (0) | 2007.03.03 |
---|---|
vpython으로 3D Programming 시작하기 #6 (0) | 2007.03.03 |
JavaTM Web Start (0) | 2007.03.02 |
김상욱의 웹스타트(webstart) 강좌 (0) | 2007.03.02 |
RIA(Rich Internet Application)를 알려주다! (0) | 2007.03.02 |