[Index for tmp_for_tar/vrml.doc] [Return to Master Index]

vrml_lines

(tmp_for_tar/vrml.doc/vrml_lines.m)


Function Synopsis

s = vrml_lines(x,f,...)

Help text

 s = vrml_lines(x,f,...)

 x : 3xP   : The 3D points
 f : 3xQ   : The indexes of the points forming the lines. Indexes
             should be in 1:P.

 Returns a Shape -> IndexedLineSet vrml node.

 No check is done on anything

 Options :

 "col" , col  : 3x1 : Color, default = [1,0,0]

 Last modified: December 2000



Cross-Reference Information

This function calls

Listing of function file tmp_for_tar/vrml.doc/vrml_lines.m

## s = vrml_lines(x,f,...)
##
## x : 3xP   : The 3D points
## f : 3xQ   : The indexes of the points forming the lines. Indexes
##             should be in 1:P.
##
## Returns a Shape -> IndexedLineSet vrml node.
##
## No check is done on anything
##
## Options :
## 
## "col" , col  : 3x1 : Color, default = [1,0,0]
##

## Author:        Etienne Grossmann  <etienne@isr.ist.utl.pt>
## Last modified: December 2000

function s = vrml_lines(x,f,...)

col = [1, 0, 0] ;

opt1 = " col " ;
opt0 = " " ;

verbose = 0 ;

nargin -= 2 ;
while nargin>0 ,
  tmp = va_arg() ; nargin-- ;
  if ! isstr(tmp) ,
    printf("vrml_lines : Non-string option : \n") ;
    keyboard

  end
  if index(opt1,[" ",tmp," "]) ,
    
    tmp2 = va_arg() ; nargin-- ;
    nargin-- ;
    eval([tmp,"=tmp2;"]) ;

    sayif(verbose ,"vrml_lines : Read option : %s.\n",tmp) ;

  elseif index(opt0,[" ",tmp," "]) ,
    
    eval([tmp,"=1;"]) ;
    sayif(verbose ,"vrml_lines : Read boolean option : %s\n",tmp) ;

  else
    printf("vrml_lines : Unknown option : %s\n",tmp) ;
    keyboard
  end
endwhile

if exist("col")!=1,  col = [0.5, 0.5, 0.8]; end

s = sprintf([... 			# string of indexed face set
	     "Shape {\n",...
	     "  appearance Appearance {\n",...
	     "    material Material {\n",...
	     "      diffuseColor %8.3f %8.3f %8.3f \n",...
	     "      emissiveColor %8.3f %8.3f %8.3f\n",...
	     "    }\n",...
	     "  }\n",...
	     "  geometry IndexedLineSet {\n",...
	     "    coordIndex [\n%s]\n",...
	     "    coord Coordinate {\n",...
	     "      point [\n%s]\n",...
	     "    }\n",...
	     "  }\n",...
	     "}\n",...
	     ],...
	    col,col,...
	    sprintf("                    %4d, %4d, %4d, -1,\n",f-1),...
	    sprintf("                 %8.3f %8.3f %8.3f,\n",x)) ;



Produced by oct2html on Sat Dec 2 19:08:39 2000
Cross-Directory links are: ON