XRacer::BVRML(3pm)

XRacer::BVRML3pm

Parser for a tiny subset of vrml generated by blender

Usage

  use XRacer::BVRML;

Overview

This is a parser for a tiny subset of VRML generated by Blender, so called Blender-VRML or BVRML. In fact, this parser is by no means guaranteed to be able to parse everything that Blender could generate. I will add parsing capability to it as I see the need.

"XRacer::BVRML" parses a Blender VRML file, and stores it in an internal world representation, which can be inspected and manipulated. "XRacer::BVRML" can also write out a C function containing GL commands which render this world object, and this function can then be used inside an XRacer track or craft file.

Class methods

$world = XRacer::BVRML->parse ($filename [, $world]);

This function parses a BVRML file called $filename, and generates a $world object. If the second optional $world parameter is given, then the BVRML file is parsed and the results are merged with the existing $world object.

If the parsing fails, then this function will print an error message and return "undef".

World object methods

$nr_vertices = $world->nr_vertices;

Return the total number of vertices in the world.

$nr_faces = $world->nr_faces;

Return the total number of faces in the world.

@vertices = $world->vertices;

Aggregate all vertices in the world, and return it as a list.

@faces = $world->faces;

Aggregate all faces in the world, and return it as a list.

($smallest_x, $largest_x, $smallest_y, $largest_y, $smallest_z, $largest_z) = $world->bbox;

Return the bounding box (or bounding cuboid, to be more precise) of this world.

$world->write_display_function ([name => $function_name,] [filehandle => $filehandle,] [decl => $decl]);

Write out a C function containing GL calls which, when invoked, will display this world object. The C function is called $function_name and will be written to the file specified by the $filehandle. The function will be declared as "void function_name (void)" unless the $decl parameter is given, which gives the return declaration. The C function is suitable for directly linking into XRacer craft and track files. However, it requires some support. In particular, you will need to include the header file GL/gl.h, and probably xracer.h before the function.

Releases

11 releases since Debian 3.0 (Woody); the text changed 8 times.

  1. 3.0
  2. 3.1
  3. 5.0–6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11–12
  9. 13

Author

  Richard W.M. Jones, <[email protected]>

From xracer-tools 0.96.9.1-13 in Debian 13 (Trixie). Parsed by carta from the page's man source.