VRML::Base.pm - common basic methods for VRML in/output
use VRML::Base;
Following methods are implemented.
new
Creates a new VRML scene object.
comment('string')
Inserts a single comment line at the current position. You don't need to write the # in front. If no string is given, the method inserts only a #.
insert('string')
Inserts the string at the current position in the VRML scene.
insert__DATA__()
Inserts the text block after __DATA__ of the current perl script in the VRML scene. Remember there are two underscores in front and at the end of the word DATA.
include('filename')
Inserts the VRML code of the specified file in the current scene.
print('mime', 'pipe')
Prints the VRML scene to STDOUT. If mime (bool) is given, this method prints the scene to STDOUT with the Content-type of the current scene. If pipe is given, then first the stream is send to the pipe and after that to STDOUT. This is usefull to compress the VRML code with GNU-ZIP.
Example:
1. $vrml->print
2. $vrml->print(1, 'gzip -f9')
save('filename', 'pipe')
Saves the VRML code to the specified name in filename. If no filename is given, this method uses the name of the perl script and changes the extension against .wrl. If pipe is given, then first the stream is send to the pipe and after that to STDOUT. This is usefull to compress the VRML code with GNU-ZIP.
.wrl
1. $vrml->save
2. $vrml->save(undef, 'gzip -f9')
3. $vrml->save('myScene.wrl')
as_string
Returns the VRML scene as string. Possible it uses too much memory to build the string.
You don't need the following 'native' methods. If yet, tell it me and I'll describe it in the next version.
debug
_init('VRML')
_add
_trim
_swap
_put
_row
_pos
_format
Hartmut Palm <palm@gfz-potsdam.de>
To install VRML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VRML
CPAN shell
perl -MCPAN -e shell install VRML
For more information on module installation, please visit the detailed CPAN module installation guide.