11 3D Počítačová grafika3D Počítačová grafika Matej LexaMatej Lexa IV121IV121 Informatika pro biologyInformatika pro biology 22 3D Počítačová Grafika3D Počítačová Grafika (nebo Geometrie)(nebo Geometrie) - modelování scén- modelování scén SDL (scene descriptionSDL (scene description language)language) - vizualizace scén (rendering)- vizualizace scén (rendering) - rasterizace- rasterizace - „raytracing“- „raytracing“ - zajímavé koncepty- zajímavé koncepty CSG (constructive solidCSG (constructive solid geometry)geometry) skriptování scénskriptování scén příklad generování realistickýchpříklad generování realistických stromů a keřůstromů a keřů 33 SDL – SceneSDL – Scene Description LanguagesDescription Languages VRML/X3DVRML/X3D 3DMLW3DMLW POV-Ray SDLPOV-Ray SDL Renderman shading languageRenderman shading language http://en.wikipedia.org/wiki/Scene_description_languagehttp://en.wikipedia.org/wiki/Scene_description_language RenderManRenderMan Shading LanguageShading Language Daniel ScherzerDaniel Scherzer Vienna University of TechnologyVienna University of Technology 04/22/1204/22/12 55 Co je RenderMan?Co je RenderMan? MonstersInc by Pixar A Bug‘s Life by Pixar Entropy image contest winner by Claude Schitter 04/22/1204/22/12 66 Co je RenderMan?Co je RenderMan? • Autorem je společnost Pixar (1987)Autorem je společnost Pixar (1987) • Něco jako PostScript pro 3DNěco jako PostScript pro 3D • - Scene Description Language- Scene Description Language – není modelovacím programemnení modelovacím programem – není renderingovým programemnení renderingovým programem – Rozhraním mezi modelováním a renderingemRozhraním mezi modelováním a renderingem 04/22/1204/22/12 77 Příklad Bytestream kódu proPříklad Bytestream kódu pro RenderMan InterfaceRenderMan Interface Display "RenderMan" "framebuffer"Display "RenderMan" "framebuffer" "rgb""rgb" Format 256 192 1Format 256 192 1 WorldBeginWorldBegin Surface "constant"Surface "constant" Polygon "P" [0.5 0.5 0.5 0.5 -0.5Polygon "P" [0.5 0.5 0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5]0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5] WorldEndWorldEnd 04/22/1204/22/12 88 RIBRIB Display "RenderMan" "framebuffer"Display "RenderMan" "framebuffer" "rgb""rgb" Format 256 192 1Format 256 192 1 WorldBeginWorldBegin Surface "constant"Surface "constant" Polygon "P" [0.5 0.5 0.5 0.5 -0.5Polygon "P" [0.5 0.5 0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5]0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5] WorldEndWorldEnd 04/22/1204/22/12 99 APIAPI #include #include RtPoint Square[4] = { {.5,.5,.5}, {.5,-.5,.5}, {-.5,-.5,.5},RtPoint Square[4] = { {.5,.5,.5}, {.5,-.5,.5}, {-.5,-.5,.5}, {-.5,.5,.5} };{-.5,.5,.5} }; main(void){main(void){ RiBegin(RI_NULL); /* Start the renderer */RiBegin(RI_NULL); /* Start the renderer */ RiDisplay("RenderMan", RI_FRAMEBUFFER, "rgb", RI_NULL);RiDisplay("RenderMan", RI_FRAMEBUFFER, "rgb", RI_NULL); RiFormat((RtInt) 256, (RtInt) 192, 1.0);RiFormat((RtInt) 256, (RtInt) 192, 1.0); RiWorldBegin();RiWorldBegin(); RiSurface("constant", RI_NULL);RiSurface("constant", RI_NULL); RiPolygon( (RtInt) 4, /* Declare the square */RiPolygon( (RtInt) 4, /* Declare the square */ RI_P, (RtPointer) Square, RI_NULL);RI_P, (RtPointer) Square, RI_NULL); RiWorldEnd();RiWorldEnd(); RiEnd(); /* Clean up */RiEnd(); /* Clean up */ 04/22/1204/22/12 1010 RenderMan Shading LanguageRenderMan Shading Language surface clouds(float vfreq = .8 )surface clouds(float vfreq = .8 ) {{ float sum ;float sum ; float i;float i; color white = color(1.0, 1.0, 1.0);color white = color(1.0, 1.0, 1.0); point Psh = transform("shader", P);point Psh = transform("shader", P); sum = 0;sum = 0; freq = vfreq;freq = vfreq; for (i = 0; i < 6; i = i + 1) {for (i = 0; i < 6; i = i + 1) { sum = sum + 1/freq * abs(.5 - noise(freq * Psh));sum = sum + 1/freq * abs(.5 - noise(freq * Psh)); freq = 2 * freq;freq = 2 * freq; }} Ci = mix(Cs, white, sum*4.0);Ci = mix(Cs, white, sum*4.0); Oi = 1.0; /* Always make the surface opaque */Oi = 1.0; /* Always make the surface opaque */ }} 04/22/1204/22/12 1111 RenderMan Shading LanguageRenderMan Shading Language surface clouds(float vfreq = .8 )surface clouds(float vfreq = .8 ) {{ float sum ;float sum ; float i;float i; color white = color(1.0, 1.0, 1.0);color white = color(1.0, 1.0, 1.0); point Psh = transform("shader", P);point Psh = transform("shader", P); sum = 0;sum = 0; freq = vfreq;freq = vfreq; for (i = 0; i < 6; i = i + 1) {for (i = 0; i < 6; i = i + 1) { sum = sum + 1/freq * abs(.5 - noise(freq * Psh));sum = sum + 1/freq * abs(.5 - noise(freq * Psh)); freq = 2 * freq;freq = 2 * freq; }} Ci = mix(Cs, white, sum*4.0);Ci = mix(Cs, white, sum*4.0); Oi = 1.0; /* Always make the surface opaque */Oi = 1.0; /* Always make the surface opaque */ }} 04/22/1204/22/12 1212 RenderMan Shading LanguageRenderMan Shading Language surface clouds(float vfreq = .8 )surface clouds(float vfreq = .8 ) {{ float sum ;float sum ; float i;float i; color white = color(1.0, 1.0, 1.0);color white = color(1.0, 1.0, 1.0); point Psh = transform("shader", P);point Psh = transform("shader", P); sum = 0;sum = 0; freq = vfreq;freq = vfreq; for (i = 0; i < 6; i = i + 1) {for (i = 0; i < 6; i = i + 1) { sum = sum + 1/freq * abs(.5 - noise(freq * Psh));sum = sum + 1/freq * abs(.5 - noise(freq * Psh)); freq = 2 * freq;freq = 2 * freq; }} Ci = mix(Cs, white, sum*4.0);Ci = mix(Cs, white, sum*4.0); Oi = 1.0; /* Always make the surface opaque */Oi = 1.0; /* Always make the surface opaque */ }} 04/22/1204/22/12 1313 RenderMan Shading LanguageRenderMan Shading Language surface clouds(float vfreq = .8 )surface clouds(float vfreq = .8 ) {{ float sum ;float sum ; float i;float i; color white = color(1.0, 1.0, 1.0);color white = color(1.0, 1.0, 1.0); point Psh = transform("shader", P);point Psh = transform("shader", P); sum = 0;sum = 0; freq = vfreq;freq = vfreq; for (i = 0; i < 6; i = i + 1) {for (i = 0; i < 6; i = i + 1) { sum = sum + 1/freq * abs(.5 - noise(freq * Psh));sum = sum + 1/freq * abs(.5 - noise(freq * Psh)); freq = 2 * freq;freq = 2 * freq; }} Ci = mix(Cs, white, sum*4.0);Ci = mix(Cs, white, sum*4.0); Oi = 1.0; /* Always make the surface opaque */Oi = 1.0; /* Always make the surface opaque */ }} 04/22/1204/22/12 1414 RIB s použitím “Shader” kóduRIB s použitím “Shader” kódu Display "RenderMan" "framebuffer"Display "RenderMan" "framebuffer" "rgb""rgb" Format 256 192 1Format 256 192 1 WorldBeginWorldBegin Surface "clouds"Surface "clouds" Polygon "P" [0.5 0.5 0.5 0.5 -0.5Polygon "P" [0.5 0.5 0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5]0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5] WorldEndWorldEnd 04/22/1204/22/12 1515 ResultResult 04/22/1204/22/12 1616 Součásti systému RenderManSoučásti systému RenderMan Rman Geom Code cc Rman Program Rman Shader .sl shader Byte-code Shader .slo RIB File render Program TIFF image Rman texture Image File txmake 04/22/1204/22/12 1717 Surface ShaderSurface Shader uniform varying surface plastic( float Ks = .5, Kd = .5,surface plastic( float Ks = .5, Kd = .5, Ka = 1, roughness = .1;Ka = 1, roughness = .1; color specularcolor = 1 )color specularcolor = 1 ) {{ normal Nf = faceforward(normalize(N), I );normal Nf = faceforward(normalize(N), I ); vector V = normalize(-I);vector V = normalize(-I); Oi = Os;Oi = Os; Ci = Os*( Cs * (Ka*ambient()+Ci = Os*( Cs * (Ka*ambient()+ Kd*diffuse(Nf))+Kd*diffuse(Nf))+ specularcolor * Ks *specularcolor * Ks * specular(Nf,V,roughness) );specular(Nf,V,roughness) ); }} 04/22/1204/22/12 1818 Light ShaderLight Shader lightlight pointlight(pointlight( float intensity = 1;float intensity = 1; color lightcolor = 1;color lightcolor = 1; point from = point "camera"point from = point "camera" (0,0,0) )(0,0,0) ) {{ illuminate( from )illuminate( from ) Cl = intensity * lightcolor / L.L;Cl = intensity * lightcolor / L.L; }} 04/22/1204/22/12 2020 2121 „„Rendering“Rendering“ - rasterizace- rasterizace Vlastnosti všech bodů vVlastnosti všech bodů v prostoru/modelu jsou lokálně definoványprostoru/modelu jsou lokálně definovány - “raytracing“- “raytracing“ Vlastnosti bodů jsou ovlivněnyVlastnosti bodů jsou ovlivněny globálně všemi ostatními body veglobálně všemi ostatními body ve scéně/modelu.scéně/modelu. Dokáže správně vykreslitDokáže správně vykreslit tansparetnost, refrakci světla a podobnétansparetnost, refrakci světla a podobné efekty.efekty. 2222 Rendering Pipeline - OpenGLRendering Pipeline - OpenGL Aaron BloomfieldAaron Bloomfield CS 445: Introduction to GraphicsCS 445: Introduction to Graphics Fall 2006Fall 2006 (Slide set originally by Greg Humphreys)(Slide set originally by Greg Humphreys) 2323 3D Polygon Rendering3D Polygon Rendering • Many applications use rendering of 3DMany applications use rendering of 3D polygons with direct illuminationpolygons with direct illumination 2424 3D Polygon Rendering3D Polygon Rendering • Many applications use rendering of 3DMany applications use rendering of 3D polygons with direct illuminationpolygons with direct illumination 2525 3D Rendering Pipeline3D Rendering Pipeline 3D Geometric Primitives Modeling Transformation Viewing Transformation Projection Transformation Lighting Image Clipping Scan Conversion This is a pipelined sequence of operations to draw a 3D primitive into a 2D image (this pipeline applies only for direct illumination) 2626 3D Rendering Pipeline3D Rendering Pipeline Modeling Transformation Lighting & Texturing Projection Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Transform into 3D world coordinate system 2727 3D Rendering Pipeline3D Rendering Pipeline Modeling Transformation Lighting & Texturing Projection Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Transform into 3D world coordinate system Transform into 3D camera coordinate system Done with modeling transformation 2828 3D Rendering Pipeline3D Rendering Pipeline Modeling Transformation Lighting & Texturing Projection Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Transform into 3D world coordinate system Transform into 3D camera coordinate system Done with modeling transformation Illuminate according to lighting and reflectance Apply texture maps 2929 3D Rendering Pipeline3D Rendering Pipeline Modeling Transformation Lighting & Texturing Projection Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Transform into 3D world coordinate system Illuminate according to lighting and reflectance Apply texture maps Transform into 2D screen coordinate system Transform into 3D camera coordinate system Done with modeling transformation 3030 3D Rendering Pipeline3D Rendering Pipeline Modeling Transformation Lighting & Texturing Projection Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Transform into 3D world coordinate system Clip primitives outside camera’s view Transform into 2D screen coordinate system Transform into 3D camera coordinate system Done with modeling transformation Illuminate according to lighting and reflectance Apply texture maps 3131 3D Rendering Pipeline3D Rendering Pipeline Modeling Transformation Lighting & Texturing Projection Transformation Viewing Transformation 3D Geometric Primitives Image Clipping Scan Conversion Transform into 3D world coordinate system Draw pixels (includes texturing, hidden surface, ...) Clip primitives outside camera’s view Transform into 2D screen coordinate system Transform into 3D camera coordinate system Done with modeling transformation Illuminate according to lighting and reflectance Apply texture maps 3232 Viewing TransformationViewing Transformation • Mapping from world to camera coordinatesMapping from world to camera coordinates – Eye position maps to originEye position maps to origin – Right vector maps to X axisRight vector maps to X axis – Up vector maps to Y axisUp vector maps to Y axis – Back vector maps to Z axisBack vector maps to Z axis x y z World right up back Camera View plane 3333 ProjectionProjection • General definition:General definition: – Transform points inTransform points in nn-space to-space to mm-space (-space (m 0 x x+1 y+1 y ? ? At each step: x++ ; if ( δ– > δ+) y++ ; δ– δ+ Let p = ∆x ( δ– – δ+ ). Then: At each step: x++ ; if ( p > 0 ) y++ ; update p ; “true line” imagine pixel centers at grid vertices Can we do this with simple all-int arithmetic? Yes! The Bresenham Algorithm void line( int xA, int yA, int xB, int yB ) // Special case: shallow increasing slope. { const int DX= xB - xA ; const int DY= yB - yA ; const int DP_FLAT= 2*DY ; const int DP_JUMP= DP_FLAT - 2*DX ; assert( 0 < DY && DY < DX ) ; int x= xA ; int y= yA ; int p= 2*DY - DX ; pix( xA, yA ) ; while ( x < xB ) { x++ ; if ( p > 0 ) { ++y ; p+= DP_JUMP ; } else p+= DP_FLAT ; pix( x, y ) ; } } initial values Scan-converting Circles - 2 8-fold symmetry m > 1 x++ if ( p > 0 ) y-- ; Stack-based Pixel Filling By Runs - 1 seed Stack-based Pixel Filling By Runs - 2 Fill the scan line Stack-based Pixel Filling By Runs - 3 Push seeds for the next step rightmost left pixels, above & below Polygon Filling - 2 a b c d e f g h a b c d e f g h active edge list (AEL) ymin ymax y 700 300 ix= 700 YHI = 300 INVSLOPE = -0.9g Z-Buffering for each polygon for each scanline for each pixel in scanline update depth at pixel if pixel depth < buffered depth write to screen & depth buffers Two buffers - screen buffer (color) - depth buffer 5656 Ray TracingRay Tracing Mani ThomasMani Thomas CISC 440/640CISC 440/640 Computer GraphicsComputer Graphics 5757 FotorealismusFotorealismus Created by David Derman – CISC 440 5858 FotorealismusFotorealismus Created by Jan Oberlaender – CISC 640 5959 Created by Donald Hyatt http://www.tjhsst.edu/~dhyatt/superap/povray.html 6060 ÚvodÚvod  Co je Ray Tracing?Co je Ray Tracing?  Ray Tracing je renderingová metoda založena naRay Tracing je renderingová metoda založena na globálním osvětlení scény, která generuje realistickéglobálním osvětlení scény, která generuje realistické obrazy pomocí počítače.obrazy pomocí počítače.  V ray tracing-u, paprsek světla je sledován podél svéV ray tracing-u, paprsek světla je sledován podél své dráhy v opačném směru.dráhy v opačném směru.  Začínáme od kamery směrem ke zdroji světla a zjišťujemeZačínáme od kamery směrem ke zdroji světla a zjišťujeme stav objektů protínajících dráhu paprskustav objektů protínajících dráhu paprsku  Daný obrazový bod je nastaven na barvu odpovídajícíDaný obrazový bod je nastaven na barvu odpovídající danému paprsku.danému paprsku.  Pokud paprsek nenarazí na žádný předmět je bod nastavenPokud paprsek nenarazí na žádný předmět je bod nastaven na barvu pozadí.na barvu pozadí. 6161 Ray Casting/TracingRay Casting/Tracing  Ray CastingRay Casting  Paprsky se zastaví naPaprsky se zastaví na prvním objektuprvním objektu  Ray TracingRay Tracing  RekurzeRekurze předcházejícíhopředcházejícího principuprincipu Courtesy: Angel Šíření světlaŠíření světla • Typy paprskůTypy paprsků Image copyrightImage copyright Jacco Bikker.Jacco Bikker. 6464 Algoritmus – Ray castingAlgoritmus – Ray casting Courtesy F.S. Hill, “Computer Graphics using OpenGL” 6565 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 6666 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 6767 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 6868 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 6969 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 7070 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 7171 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 7272 Ray TracingRay Tracing created by Michael Sweeny, et al for ACM SIGGRAPH Education slide set 1991 7373 OdrazOdraz Created by David Derman – CISC 440 7474 OdrazOdraz Created by David Derman – CISC 440 7575 OdrazOdraz Created by David Derman – CISC 440 7676 Lom světlaLom světla 2211 sinsin θθ cc = Courtesy F.S. Hill, “Computer Graphics using OpenGL” Jiné efektyJiné efekty • • Hloubka ostrostiHloubka ostrosti – Image copyright Josef Pelikan http://cgg.ms.mff.cuni.cz/gallery/ Jiné efektyJiné efekty • Rozmazání pohybemRozmazání pohybem – Image copyright Josef Pelikan http://cgg.ms.mff.cuni.cz/gallery/ 7979 Strom světlaStrom světla  Informace o paprsku sčítajíInformace o paprsku sčítají 8080 Super-samplingSuper-sampling  Vyhlazení hranVyhlazení hran Courtesy F.S. Hill, “Computer Graphics using OpenGL” 8181 ObalObal Obal skupiny objektůObal skupiny objektů • Image copyright Jacco BikkerImage copyright Jacco Bikker Prostorové rozdělení úlohProstorové rozdělení úloh Nerovnoměrné rozdělení naNerovnoměrné rozdělení na podprostorypodprostory Image copyright Worcester Polytechnic Institute 8585 ReferencesReferences  TextbooksTextbooks  F. S. Hill, “Computer Graphics Using OpenGL”F. S. Hill, “Computer Graphics Using OpenGL”  Commonly used ray tracing program (completelyCommonly used ray tracing program (completely free and available for most platforms)free and available for most platforms)  http://www.povray.org/http://www.povray.org/  Interesting LinksInteresting Links  Interactive Ray Tracer – Alyosha EfrosInteractive Ray Tracer – Alyosha Efros  http://www.cs.berkeley.edu/~efros/java/tracer/tracer.htmlhttp://www.cs.berkeley.edu/~efros/java/tracer/tracer.html  Ray Tracing explainedRay Tracing explained  http://www.geocities.com/jamisbuck/raytracing.htmlhttp://www.geocities.com/jamisbuck/raytracing.html  http://www.siggraph.org/education/materials/HyperGraph/rhttp://www.siggraph.org/education/materials/HyperGraph/r Structure Visualization ToolsStructure Visualization Tools Written by James ColemanWritten by James Coleman Presented by Xiang ZhouPresented by Xiang Zhou Structure VisualizationStructure Visualization  One of the primary activities in proteomicsOne of the primary activities in proteomics R&D is determining and Visualizing the 3DR&D is determining and Visualizing the 3D structure of proteins in order to find wherestructure of proteins in order to find where drugs might modulate their activity.drugs might modulate their activity.  Other activities include identifying all of theOther activities include identifying all of the proteins produced by a given cell or tissueproteins produced by a given cell or tissue and determining how these proteinsand determining how these proteins interact.interact.  BIOINFORMATICS COMPUTING, p.186, Bryon Bergeron, M.D., Prentice Hall 2002BIOINFORMATICS COMPUTING, p.186, Bryon Bergeron, M.D., Prentice Hall 2002 Some Common ToolsSome Common Tools  100’s of visualization tools have been100’s of visualization tools have been developed in bioinformatics.developed in bioinformatics.  Many are specific to hardware such asMany are specific to hardware such as microarray devices.microarray devices.  Shareware utilities for PC’sShareware utilities for PC’s  PDB Viewer, WebMol, RasMol, Protein Explorer, Cn3DPDB Viewer, WebMol, RasMol, Protein Explorer, Cn3D  VMD, MolMol, MidasPlus, Pymol, Chime, ChimeraVMD, MolMol, MidasPlus, Pymol, Chime, Chimera Application Feature SummaryApplication Feature Summary Feature RasMol Cn3D PyMol SWISS- PDBViewer Chimera Architecture Stand-Alone Plug-in Web- Enabled Web-enabled Web-enabled Manipulation Power Low High High High High Hardware Requirements Low/Moderate High High Moderate High Ease of Use High; command line Moderate Moderate High Moderate;GUI +command line Special Features Small Size; easy install Powerful GUI GUI; ray tracing Powerful GUI GUI; collaboration Output Quality Moderate Very high High High Very high Documentation Good Good Limited Good Very good Support Online; Users groups Online; Users groups Online; Users groups Online; Users groups Online; Users groups Speed High Moderate Moderate Moderate Moderate/Slow OpenGL Support Yes Yes Yes Yes Yes Molecule RepresentationsMolecule Representations Wireframe Bonds and Bond Angles Ball and Stick Shows Atoms, Bonds and Bonds Angles Ribbon diagrams Shows Secondary Structure Van der Waals surface Diagram Shows Atomic Volumes Backbone Shows Overall Molecular Structure Wireframe used to show individual chains:Wireframe used to show individual chains: Stick view showing atoms and bonds:Stick view showing atoms and bonds: Surface View showing surface fields:Surface View showing surface fields: Ribbon view of secondary structure:Ribbon view of secondary structure: Distinct geometrical features by color:Distinct geometrical features by color: Other properties that can be VisualizedOther properties that can be Visualized  MolMol supports the display of electrostatic potentialsMolMol supports the display of electrostatic potentials across a protein molecule.across a protein molecule.  MidasPlus (a predecessor of Chimera) allows for theMidasPlus (a predecessor of Chimera) allows for the editing of sequences visually to see the effects ofediting of sequences visually to see the effects of point mutations.point mutations. For Protein interactions, we need aFor Protein interactions, we need a metaphor that reveals dynamicsmetaphor that reveals dynamics  Haptic Joystick:Haptic Joystick: Provides forceProvides force feedback when userfeedback when user manipulates amanipulates a molecule near anothermolecule near another one.one.  3D Goggles combined3D Goggles combined with haptic gloves towith haptic gloves to feel electrostaticfeel electrostatic potentials and seepotentials and see tertiary structuretertiary structure dynamics.dynamics.  PyMol providesPyMol provides scripting that canscripting that can produce a movie in 3Dproduce a movie in 3D of the geometricalof the geometrical relationship betweenrelationship between multiple proteins.multiple proteins. Stereo view of interaction of two proteins. Scripting allows for the movement of individual molecules creating a movie. The PYMOL Molecular Graphic SystemThe PYMOL Molecular Graphic System PYMOLPYMOL • It supports Windows, Macintosh, Linux, Solaris, IRIX • Freely available @ http://www.pymol.org/ Basic modulesBasic modules PDB filePDB file Coordinates Temp. factorResidue # Chain # Load data-file-name Load files 1 2 Load your pdb fileLoad your pdb file External GUI: file-open Command lines: load file-path (e.g., load $c/1hng.pdb) Manipulate the view by mouseManipulate the view by mouse Actions Show Hide Color Important panelsImportant panels Manipulate your objectsManipulate your objects Right click: more choices Right click your mouse: more optionsRight click your mouse: more options Actions: show B-factor puttyActions: show B-factor putty Actions: generating electrostatics mapActions: generating electrostatics map Actions: Find polar contactsActions: Find polar contacts Name panel: your selected residues Actions-Find-Polar contacts-… Actions: OthersActions: Others  Adding or removing Hydrogen atoms  Counting atom numbers or net charges  Masking or unmasking residues  Objects operations Stick Ribbon SurfaceCartoon Show: Different visual effectsShow: Different visual effects automatic tube loop putty Different way of cartoon presentationDifferent way of cartoon presentation Build: sculptingBuild: sculpting Ctrl+ left click  Also can build structures by adding or deleting atoms, bonds and amino acids SettingSetting MouseMouse Wizard: Measuring distancesWizard: Measuring distances External GUI: wizard-measurement Then click the target atoms Wizard: Making mutationsWizard: Making mutations Overlay two structuresOverlay two structures Align filenameA//2-240/CA, filenameB//2-240/CA Make moviesMake movies Util.mrock(start,finish,angle,phase,loop-flag) Util.mroll(start,finish,loop-flag) e.g., load $c/3cln.pdb mset 1 x60 util.mrock 1,60,180 Create a 60 frame movie with +/- 90 deg. rock load $c/3cln.pdb mset 1 x60 util.mrock 1,60 Create full rotation around the Y axis over 60 frames ImageJ, or Xnview and UnFREEz to generate movies Simplest way: Fetch filename, mplay Scripts animation in Pymol