Part 1:
Getting started
Tutorials >  Surf1      [ site map ]
News
Features
Features
Download
Tutorials
Links
   

How to use your GRASP surface files in Pov4Grasp

Part 1: Getting started

Part 1   Part 2   Part 3   Part 4




  1. Our first trial
  2. Let's add some finishes
  3. Adding (multi-layered) textures



Let's start with the most simple thing we can do. The following example shows the minimal definition of the grasp_surface object (apart from the scale command and correct_translate() macro). Its first item must be the name of the GRASP surface file within quotes; here it's "crambin.srf". The object uses default parameters, so it is simply colored white.


  Our first trial
test01.p4g (script below)  scene.inc  crambin.srf.gz
#version 3.1;
#include "scene.inc"

grasp_surface
{
  "crambin.srf"

  scale <1,1,-SYSTEM>
  correct_translate(-11,-10.5,0)
}
test01
 


The surface looks like what you get by default in your GRASP session, with added projected shadows and a floor. Now let's change a bit the texture of the surface. We want it to be shiny like porcelain; this can be done through a standard finish statement as below:


  Let's add some finishes
test02.p4g  scene.inc  crambin.srf.gz
#version 3.1;
#include "scene.inc"

grasp_surface
{
  "crambin.srf"
  finish{ diffuse 0.6  specular 0.75  roughness 0.005 }

  scale <1,1,-SYSTEM>
  correct_translate(-11,-10.5,0)
}
test02
 


And what about more sophisticated textures ? As for any standard object, you can assign one or more textures to the grasp_surface definition, such as to get this stone appearence:


  Adding (multi-layered) textures
test03.p4g  scene.inc  crambin.srf.gz
#version 3.1;
#include "scene.inc"
#include "colors.inc"
#include "textures.inc"
#include "stones.inc"

grasp_surface
{
  "crambin.srf"

  texture{ T_Stone9  rotate<-30,15,5>  scale 4.5 }
  normal { bumps 0.9 }
  finish{ diffuse 0.6  specular 0.75  roughness 0.005 }

  scale <1,1,-SYSTEM>
  correct_translate(-11,-10.5,0)
}
test03
 


All those things are really simple and work just like any other POV-Ray object. A stone texture is interesting, but probably not much useful in the field of structural biology... In the next part we discuss on how to map some relevant property on the molecular surface.



previous   next



Valid HTML 4.01! Page last updated: Jun 20, 2002
Any comment or suggestion ?