1/7 >>

cgkit

Python¤Ç³Ø¤ÖRenderMan Interface

ÍÑ°Õ¤¹¤ë¤â¤Î¡£
¢£Python-2.3.5.exe
¢£PIL-1.1.5.win32-py2.3.exe
¢£PyProtocols-0.9.3.win32-py2.3.exe
¢£cgkit-2.0.0alpha5.win32-py2.3.exe
¢£pygame-1.6.2.win32-py2.3.exe
¢£Aqsis
¢£3delight-4.5.0-setup.exe

¥¤¥ó¥¹¥È¡¼¥ë¤ÏÂбþ¤¹¤ëPython2.3.5±Ñ¸ìÈǤò»È¤¦¡£

¥³¥Þ¥ó¥É¥×¥í¥ó¥×¥È¤«¤é
>viewer.py helloworld.py

OpenGL¤Çµ¯Æ°¡£Maya¤ÈƱ¤¸¤è¤¦¤ËAlt¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¡¤¥«¥á¥é²óž¤¬¤Ç¤­¤ë¡£

>>> from cgkit import *
¤Ç¤Ï¤Ê¤¯¤Æ¡¤
>>> from cgkit.all import *
¤ò»È¤Ã¤Æ¤¤¤ë¡£

http://cgkit.sourceforge.net/
  • -
  • -

cgkit2¤Î¥¤¥ó¥¹¥È¡¼¥ë¡£python24¤ò»È¤Ã¤¿¡£

-------------------------------------------------------------
http://peak.telecommunity.com/PyProtocols.html¤«¤é PyProtocols-0.9.3.zip¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤­¤Þ¤¹¡£(Python2.4ÍѤΥХ¤¥Ê¥ê¤Ï̵¤¤)

¤½¤ì¤òŸ³«¤·¤Æ¡¢

python setup.py install

python setup.py test

ÌäÂê¤Ê¤¤¤è¤¦¤Ê¤éOK¡£
------------------------------------------------------------

¿·¤¿¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤·¤¿¡£
Visual Studio 2003(version7.1)¤¬Æþ¤Ã¤Æ¤¤¤Ê¤¤¤ÈPyProtocol¤Ï¥³¥ó¥Ñ¥¤¥ë¤¬¤Ç¤­¤Ê¤¤¤è¤¦¤Ç¤¹¤Í¡£
¥Þ¥·¥ó¤ËPython22jp¤äPython23¤¬Æþ¤Ã¤Æ¤¤¤¿¤Î¤Ç,ºÇ½é¥Ñ¥¹¤¬¤¦¤Þ¤¯¤È¤ª¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
>c:\python24\python setup.py install
¤Ç¤¦¤Þ¤¯¤¤¤­¤Þ¤·¤¿¡£

¤¢¤È¡¤pygame-1.7.1release.win32-py2.4.exe
PIL-1.1.5.win32-py2.4.exe
¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤é¡¤OpenGLɽ¼¨¤È¸ß´¹¥ì¥ó¥À¥é¡¼¤Ç¥ì¥ó¥À¥ê¥ó¥°¤Ç¤­¤Þ¤·¤¿¡£
Ambient Occlusion¤Èbake¤¬µ¤¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ç¤³¤ì¤«¤éÊÙ¶¯¤·¤è¤¦¤È»×¤¤¤Þ¤¹¡£
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
  • -
  • -

cgkit2¤Î¥¤¥ó¥¹¥È¡¼¥ë(¤½¤Î2)

»Å»ö¾ì¤ÇCgkit2¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤è¤¦¤È¤·¤¿¡£
·ë¶É¤Ç¤­¤º¡£
¼«Âð¤ÏVisual C++ .Net Standard 2003¤ÈMSDN Library for Visual Studio .Net 2003¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤«¤é,¤¦¤Þ¤¯¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤¿ÌÏÍÍ¡£

¤¦¡¼¤ó¡¤±Ñ¸ìÈǤÈÆüËܸìÈǤǤϤÁ¤¬¤¦¤Î¤«¡£

Windows¤ÇFree¤ÊC¥â¥¸¥å¡¼¥ë¥Ó¥ë¥É´Ä¶­
http://www.freia.jp/taka/memo/freevcbuild

Python 2.4 Extensions w/ the MS Toolkit Compiler
http://www.vrplumber.com/programming/mstoolkit/

̵ÎÁ¤Ç¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ó¤È¤«¤·¤¿¤¤¤â¤Î¤Ç¤¹¤è¡£
  • -
  • -

Cgkit2.0alpha7¥¤¥ó¥¹¥È¡¼¥ë

Visual Studio .NET2003¤ÈMSDN Library(ºÇ¾®)¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¡¤
Python2.4¤Ï¥¤¥ó¥¹¥È¡¼¥ë¸å
¥·¥¹¥Æ¥à´Ä¶­ÊÑ¿ô¤ÎPath¤ò¤­¤Á¤ó¤È»ØÄꤷ¤¿¡£
C:\Python24;C:\Python24\Scripts;
ºÆµ¯Æ°¤·¤¿¤é¡¤

>viewer.py demo1.py

OpenGLɽ¼¨¤·¤¿¡£
  • -
  • -

Cgkit2.0alpha5¥¤¥ó¥¹¥È¡¼¥ë

´û¤Ëalpha5¤Ï¼ê¤ËÆþ¤é¤Ê¤¤¤¬,¤Þ¤È¤á¤Æ¤ß¤¿¡£

¢£¢£Cgkit¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ë¤Ä¤¤¤Æ¢£¢£

­¡Python-2.3.5.exe¤ò¥¤¥ó¥¹¥È¡¼¥ë
­¢PyProtocols-0.9.3.win32-py2.3.exe
­£PIL-1.1.5.win32-py2.3.exe
­¤pygame-1.6.win32-py2.3.exe
­¥cgkit-2.0.0alpha5.win32-py2.3.exe
­¦Pixie-1.7.6-Setup.exe

­§Sample¤òC:\Python23¤Ë¥³¥Ô¡¼¤¹¤ë¡£

­¨¥Þ¥¤¥³¥ó¥Ô¥å¡¼¥¿¤ò±¦¥¯¥ê¥Ã¥¯¤·¡¢
¡Ö¥×¥í¥Ñ¥Æ¥£¡×¢ª¡Ö¾ÜºÙÀßÄê¡×
¢ª¡Ö´Ä¶­ÊÑ¿ô¡×¢ª¡Ö¥·¥¹¥Æ¥à´Ä¶­ÊÑ¿ô¡×¤ÎPath¤ò¥¯¥ê¥Ã¥¯
¡ÖÊÔ½¸¡×¤ò²¡¤·¤Æ¡ÖÊÑ¿ôÃ͡פ˼¡¤Îʸ¤òÄɲ乤롣

;C:\Python23;C:\Python23\Scripts


¢£¢£
­©¥³¥Þ¥ó¥É¥×¥í¥ó¥×¥È¤Ç
Open GLɽ¼¨¤µ¤ì¤¿¤éÀ®¸ù!!

>Viewer.py helloworld.py


­ªRenderingɽ¼¨
RenderMan Renderer "Pixie"¤ò»È¤Ã¤Æ¤¤¤ë¡£

>Render.py -r pixie helloworld.py

--------------------------------------
cgkit-2.0.0alpha6.win32-py2.3.exe¤¬¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤ë¤±¤É¡¤Render.py¤Ç¥¨¥é¡¼¤¬½Ð¤Æ¤·¤Þ¤¦¡£¤¦¤Þ¤¯¥ì¥ó¥À¥ê¥ó¥°¤Ç¤­¤Ê¤¤¡£
¤è¤Ã¤Æ¥Ð¡¼¥¸¥ç¥ó¥À¥¦¥ó¤·¤¿¡£

Python2.4¤Ç¤ÎCgkit2.0alpha7¤ÏÌÌÇò¤¤¡£
grow.py¤Ç¤ÎÎý½¬¡£RiCurves()¤Î½ñ¤­Êý¤òÊÙ¶¯¤·¤Ê¤¤¤È¡£
Àè¶î¼Ô¤ÎÏÀʸ¤¬Æɤá¤ë¤è¤¦¤Ë´·¤ì¤Ê¤¤¤È¡¦¡¦¡¦²ÝÂê¤Ï¤¿¤¯¤µ¤ó¡£
  • -
  • -

PyProtocols

Visual Studio¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤ê¤·¤Æ,ÂçÁû¤®¤·¤¿PyProtocols¤À¤±¤É¡¤
Python¤Ë¤Ï¡¤egg¤È¤¤¤¦¤Î¤¬¤¢¤ë¤Î¤Ç¤¹¤Í¡£
¥Í¥Ã¥È¤«¤éõ¤·¤Æ¤­¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¯¤ì¤ëÊØÍø¥Ä¡¼¥ë
ez_setup.py¤¬¤¢¤ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤«¡£

¤Þ¤º¡¤Python2.4¤ò¥¤¥ó¥¹¥È¡¼¥ë
¤¤¤í¤¤¤í¤Ê¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¡£
PyProtocol¤ÏWindowsÍѤΥ¤¥ó¥¹¥È¡¼¥é¤¬¤Ê¤¤¤Î¤Ç¡¤Á°²óÂçÊѤÀ¤Ã¤¿¡£
º£²ó¤Ï
C:\Python24>python ez_setup.py
¤È¤ä¤ë¤È¡¤easy_install¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¯¤ì¤ë¡£

¸å¤Ï¡¤Path¤äPythonPath¤òÀßÄꤷ¤Æ¡¤ºÆµ¯Æ°¡£

¤¢¤é¤«¤¸¤á½àÈ÷¤·¤Æ¤ª¤¤¤¿PyProtocols-0.9.3-py2.4-win32.egg¤Îegg¤òC:\Python24¤Ë¤ª¤¤¤Æ¤ª¤¯¡£

³¤¤¤Æ¡¤
C:\Python24\Scripts>easy_install C:\Python24\PyProtocols-0.9.3-py2.4-win32.egg

¤¢¤Ã¤±¤Ê¤¯¥¤¥ó¥¹¥È¡¼¥ë´°Î»¡£

¤³¤ì¤Ç¡¤CGkit¤¬»È¤¨¤Þ¤¹¡£
  • -
  • -

Cgkit¤Ç¥ì¥ó¥À¥ê¥ó¥°

¥á¥¿¥»¥³¥¤¥¢¤Î¥µ¥ó¥×¥ë¥á¥«¤ÏUV¥Þ¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¤
OBJ¤Ç½ÐÎϤ·¡¤cgkit¤Çµ­½Ò¤·¤Æ¤ß¤ë¡£
¥ª¥Ö¥¸¥§¥¯¥È¤´¤È¤Ë»ØÄꤷ¤Æ¤¢¤²¤ì¤ÐÂç¾æÉס£
------------------------------------------------
load("meka.obj")
meka01 = worldObject("body01")
floor = worldObject("obj1")

mat_meka01 = GLMaterial(
diffuse = (0.9,0.9,1),
texture = GLTexture("00tex_master.BMP",
mode = GL_DECAL,
transform = mat4().scaling(vec3(1,-1,1)))
)
meka01.setMaterial(mat_meka01)

mat_floor = GLMaterial(diffuse=(0.5,0.7,0.4))
floor.setMaterial(mat_floor)
----------------------------------------------
¥é¥¤¥È¤âȾ±Æ¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤ß¤ë¡£
# ...and a spot light
lgt = GLTargetSpotLight(
pos = (-500,500,300),
target = (0,0,0),
cutoff=90.0,
exponent = 4,
intensity = 1.2
)
# The following line is used by the RenderMan exporter to create a shadow
# map. The value is a tuple (map resolution, width, blur, bias, samples)
lgt.shadowmap = (512, 1.0, 0.02, 0.02, 32)

# Create a distant light (that does not cast shadows)

GLTargetDistantLight(
pos = (-5,300,40),
target = (0,0,0),
intensity = 0.4
)
----------------------------------------------------------------
¥ì¥ó¥À¥ê¥ó¥°·ë²Ì ³¤­¤òÆɤà¡ä¡ä
  • -
  • -

Python CG Kit

Python¤ò»È¤Ã¤Æcgkit¤¤¤í¤¤¤í¤È»î¤·¤Æ¤ß¤ë¡£
RenderMan API¤Þ¤ï¤ê¤Ènoise()¤¬¤ï¤«¤ê¤Þ¤»¤ó¡£
grow.py¤ÎÀßÄê¤Ç¤­¤Á¤ó¤È¤·¤¿RIB¤¬½ÐÎϤµ¤ì¤Ê¤¤¤È¥ì¥ó¥À¥ê¥ó¥°»þ¤Ë¥Ï¡¼¥É¥Ç¥£¥¹¥¯¤¬¥«¥¿¥«¥¿¤È¤Ê¤ê³¤±¤ë¥ä¥Ð¥¤¾õÂ֤ˤʤë¤Î¤Ç²¿¤È´ØÏ¢¤·¤Æ¤¤¤ë¤«Í×¥Á¥§¥Ã¥¯¤À¡£
out0.png

¤È¤ê¤¢¤¨¤º¡¢ÊÙ¶¯¤Ç¤¹¤Í¡£¥é¥ó¥À¥à¤ËµåÂΤò200¸ÄÇÛÃÖ¡£-5¤«¤é5¤Î´Ö¤Ç
¤¦¤Þ¤¯¤¯¤ß¤¿¤¤¤È¤³¤í¡£ÊÙ¶¯¡¢ÊÙ¶¯¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
out.png
  • -
  • -

Cgkit¤ÎÊÙ¶¯

PythonÊÙ¶¯Ãæ¡£
Ê£¿ô¤Î¥â¥Ç¥ë¤ò·«¤êÊÖ¤·¤ÇºîÀ®¡£¿ô³Ø¤ÎÉü½¬¤Ç¤¹¡£
"""
for k in range(10, 100,5) :
for i in range(0, k) :
Sphere(
pos=vec3(k/10.0/math.pi*cos(2*math.pi/k*i),k/10.0/math.pi*sin(2*math.pi/k*i), 0.5),
radius=0.1,
material = GLMaterial(diffuse=(0.9,0.2,0.1)) #red
)
"""
¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¤È»×¤Ã¤¿¤é¡¢À°¿ô10¤Ç¤Ï¤Ê¤¯¤Æ¡¢10.0¤Ç½ü»»¤·¤Ê¤¤¤È1.5¤Ê¤É¤Î¾®¿ôÅÀ¤¬½Ð¤Æ¤³¤Ê¤«¤Ã¤¿¤ó¤À¡£Python¤Î´ðÁäò·«¤êÊÖ¤·³Ø½¬¤Ç¤¹¡£cgkit_sample

Houdini¤Î̵½þÈǤòDL¡¢¤³¤ì¤Ï¤³¤ì¤Ç¥Þ¥·¥ó¥¹¥Ú¥Ã¥¯¤¬Ìä¤ï¤ì¤ë¥½¥Õ¥È¥¦¥§¥¢¤Ç¡¢¤Ç¤«¤¹¤®¤Þ¤¹¡£Ä©¤ß¤¿¤¤¤È¤³¤í¡£
  • -
  • -

Cgkit Python2.5 ¥¤¥ó¥¹¥È¡¼¥ë

Python Cgkit¤òº£¤Þ¤Ç¡¢Python2.4¤Ç»È¤Ã¤Æ¤¤¤¿¤¬¡¢Python2.5¤Ëupdate¤·¤¿¡£

°Ê²¼¡¢¥¤¥ó¥¹¥È¡¼¥ë¼ê½ç:
python-2.5.2.msi
cgkit-2.0.0alpha8.win32-py2.5.exe
PIL-1.1.6.win32-py2.5.exe
pygame-1.8.0.win32-py2.5.msi

ez_setup.py¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤­¤Æ
python ez_setup.py¤Çeasy_install¤ò¥¤¥ó¥¹¥È¡¼¥ë

easy_install PyOpenGL
¤Ç¡¢pyopengl-3.0.0b3-py2.5.egg¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¡£

¤ä¤Ã¤«¤¤¤Ê¤Î¤¬¡¢Pyprotocols
PyProtocols-0.9.3.zip¤ò¥À¥¦¥ó¥í¡¼¥É

C:\Python25\PyProtocols>Python setup.py --without-speedups install

¤³¤ì¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤¤¤È¡¢render.py¤¬Æ°¤«¤Ê¤¤¤³¤È¤¬¤ï¤«¤Ã¤¿¡£
-----------------------------
explgt = protocols.adapt(obj, ILightSource)
File "C:\cygwin\home\pje\PyProtocols\src/protocols/_speedups.pyx", line 199, in _speedups.adapt
File "C:\cygwin\home\pje\PyProtocols\src/protocols/_speedups.pyx", line 188, in _speedups._adapt
TypeError: exceptions must be strings, classes, or instances, not
AdaptationFailure
---------------------
¥Þ¥·¥å¡¼¤µ¤ó¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

>render.py -r 3delight simplescene.py
¤Ç¡¢¥ì¥ó¥À¥ê¥ó¥°¤·¤¿¥µ¥ó¥×¥ë¡£

out.jpg
  • -
  • -

1/7 >>