rtexample

## 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

mged(1), rt(1), librt(3)

## AUTHORS

BRL-CAD Team

## COPYRIGHT

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

## BUG REPORTS

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