rtexample(1)

NAME

rtexample - shoots a single ray at objects in a geometry database

SYNOPSIS

rtexample model.g objects…​

DESCRIPTION

This is an example of a program that uses librt to shoot a single ray at some
geometry in a geometry (.g) database.

librt is a big library with lots of code, but basically all that the programmer
needs to do is include `raytrace.h` and specify the following:
  a_rt_i    a raytrace instance, from 'rt_dirbuild()'
  a_ray     ray origin and direction
  a_hit     function to be called if ray hits something
  a_miss    function to be called if ray misses everything

rtexample defines simple functions for a_hit and a_miss which simply
output information about hit region (if hit) and log misses. Applications will
typically define more complex tasks to fo if the ray hits, such as describing a
reflected ray.

EXAMPLE

rtexample car.g wheel door

Here, a single ray will be shot at the geometry database car.g and hit reports generated if the ray hits the specified objects.

SEE ALSO

AUTHORS

BRL-CAD Team

This software is Copyright (c) 1989-2021 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org