The cone Object
The cone object has a circular cross section and tapers to a point. The following statement will display a cone with the center of its circular base at (5,2,0), pointing parallel to the x axis with length 12; the wide end of the cone has radius 1:
cone(pos=(5,2,0), axis=(12,0,0), radius=1)
The cone object has the following attributes and default values, like those for cylinders: pos (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). As with cylinders, up has a subtle effect on the 3D appearance of a cone. Additional cone attribute:
radius Radius of the wide end of the cone, default = 1
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.
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 *
>>> cone(pos = (5,2,0), axis = (12,0,0), radius = 1)
<visual.primitives.cone object at 0x00F4D7E0>
>>> cone(pos = (7,3,1), axis = (45,3,1), radius = 4, up =(0,1,0), color = (4,1,9
))
<visual.primitives.cone object at 0x00F4D840>
>>> cone(pos = (7,3,1), axis = (0,9,0), radius = 4, up =(0,1,1), color = (9,4,3)
)
<visual.primitives.cone object at 0x00F4D870>
>>>
'기본 카테고리' 카테고리의 다른 글
자바 웹 스타트에 대한 소개 (0) | 2007.03.02 |
---|---|
사이버 Web Design 강좌 (0) | 2007.03.01 |
vpython으로 3D Programming 시작하기 #3 (0) | 2007.03.01 |
vpython 으로 3D Programming 시작하기 #2 (0) | 2007.03.01 |
vpython으로 3d 프로그래밍 시작하기 (0) | 2007.02.24 |