4. API. API. API..,.. 1
,, ISO/IEC JTC1/SC24, Working Group ISO " (Architecture) " (API, Application Program Interface) " (Metafile and Interface) " (Language Binding) " (Validation Testing and Registration)" 2
(Host Machine Independence). (Device Independence). (Programming Language Independence). (Operator Portability). 3
(Primitives) (Point), (Line), (Fill Area), (Poly Line), (Poly Marker), (Character),, (Round Cap), (Butt Cap), (Projection Cap) (Round Join), (Bevel Join), (Miter Join) (Filled Polygon), (Gradation),, 4
5
http://slideplayer.com/slide/8683348/ 6
ISO GKS(, Graphical Kernel System, 1977). 2. GKS-3D (Virtual Level),,, PHIGS(Programmer's Hierarchical Interactive Graphics System). CAD 3 (Modeling), (Viewing) = (Structure) (Traversal) (, CTM, Current Transformation Matrix) + CSG, 7
API PHIGS, GKS = API API 8
API (Scene Description Language) Camera { center {0.0 0.0 5.0} (0.0 0.0 5.0) direction {0.0 0.0-1.0} (0.0 0.0-1.0) } Lights { numlights 1 1 DirectionalLight { direction {0.5 0.5 0.5} (0.5, 0.5, 0.5) color {1.0 1.0 1.0} } } Background { color {1.0 1.0 1.0} } Group { numobject 2 2 Material {0.0, 0.0, 1.0} Sphere {2.0} 2 Transform { Translate {1.0, 0.0, 0.0} x 1.0 Scale {0.3, 0.3, 0.3} x, y, z 0.3 Material {1.0, 0.0, 0.0} Sphere {2.0} 2 } } 9
API (Scene Graph) API(High level graphic API) (open Inventor) VRML Java3D Cocos2d 10
Cocos3d 11
Scene Graph General data structure used in vector based graphics editing application or games. Acrobat 3D, AutoCAD, VRML, Open Inventor, X3D, OpenSG,.. Hierarchy of every Cocos2d NODE that's currently active. Every node has exactly one parent node, except the scene itself, and can have any number of child nodes. General technique on high level graphics system or game programming
Scene Graph CCScene CCNode CCSprite CCSprite CCSprite CCLabel CCMenu
CCNode
CCNode CCNode
CCNode CCNode CCSprite
CCNode CCNode CCSprite
CCNode CCNode add child CCSprite
CCNode CCNode add child CCSprite
CCNode CCNode add child CCSprite CCLabel
CCNode CCNode add child CCSprite CCLabel
CCNode CCNode Score: 210 add child CCSprite CCLabel
CCNode CCNode Score: 210 LIFE : 3 add child CCSprite CCLabel
CCNode CCNode Score: 210 LIFE : 3 add child CCSprite CCLabel
CCNode CCNode Score: 210 LIFE : 3 add child CCSprite CCLabel..
CCNode CCNode Score: 210 LIFE : 3 add child CCSprite CCLabel..
CCNode CCNode Score: 210 LIFE : 3 add child CCSprite CCLabel..
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel..
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 add child CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 CCNode.. CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 CCNode.. remove child CCSprite CCLabel.. CCNode CCSprite CCSprite..
CCNode Score: 210 LIFE : 3 CCNode.. remove child CCSprite CCLabel.. CCNode CCSprite CCSprite..
VRML #VRML V2.0 utf8 Shape { appearance Appearance { material Material { } } geometry Sphere { radius 1.2 } } Shape { appearance Appearance { material Material { } } geometry Cylinder { radius 0.3 height 5.0 top FALSE } } Transform { translation -6.0 2.0 0.0 children { Shape { appearance Appearance { material Material { } } geometry Cylinder { radius 0.3 height 5.0 top FALSE ] https://www.youtube.com/watch?v=kys4vsdnp6a&t=14s 16
VRML 17
https://sourceforge.net/projects/castle-engine/?source=typ_redirect 18
http://www.web3d.org/x3d/content/examples/basic/index.html 19
API 20
https://www.youtube.com/watch?v=c4cxg8zu61y 21
https://www.youtube.com/watch?v=bnv34eqluqk 22
https://www.youtube.com/watch?v=bzh64qf-eri 23
API - DirectX from Microsoft: ( ) Inventor, VRML, Java3D, Cocos2d API 24
(Generality),,. (Performance)... (Orthogonality).. (Completeness) ARB. (Interoperability) A B - (Client-Server Model).. 25
GPU CPU. Ex. 26
= 27
drawline((1, 0), (3, 0), 3, 4, (255, 0, 0)); drawline((3, 0), (2, 5), 3, 4, (255, 0, 0)); drawline((2, 5), (1, 0), 3, 4, (255, 0, 0)); setlinestyle(2); setlinewidth(4); setlinecolor(255, 0, 0); drawline((1, 0), (3, 0)); drawline((3, 0), (2, 5)); drawline((2, 5), (1, 0)); Current State 28
,, 29
glcolor3f(1.0, 1.0, 1.0); GL_CURRENT_COLOR (1.0, 1.0, 1.0). glpointsize(0.5); gllinewidth(5); glshademodel(gl_smooth); float MyColor[3]; glgetfloatv(gl_current_color, MyColor); glenable(gl_lighting); gldisable(gl_lighting); 30
float: C/C++, GLfloat: GL 31
API. 3 glvertex3f( ), 2 glvertex2f( ) 32
(GL: OpenGL Core Library) (GLU: OpenGL Utility Library) 50. GL,, 2, GL (GLUT: OpenGL Utility Toolkit) 33
The OpenGL Utility Toolkit GLUT OpenGL, OpenGL API C/C++/Ada/FORTRAN GLUT Mark Kilgard Mark Kilgard glut FreeGLUT glut 34
GLUT : (Window) : 35
GLUT https://www.youtube.com/watch?v=8p76pjsup44&t=5s http://www.mediafire.com/file/cmlnr0pj0pyha5d/glew+and+glut.zip 36
37
GLUT : (Window) : 38
macos glut 39
(Lab) 40
GLUT deprecation 41
42
#2 4 43