BRL-CAD
wray.c File Reference
#include "common.h"
#include <stdio.h>
#include <math.h>
#include "vmath.h"
#include "raytrace.h"
#include "optical.h"
Include dependency graph for wray.c:

Go to the source code of this file.

Data Structures

struct  vldray
 

Macros

#define WRAY_NORMAL(_ray, _norm)
 
#define WRAY_TAG(_ray, _ap)
 

Functions

void wray (struct partition *pp, struct application *ap, FILE *fp, const vect_t inormal)
 
void wraypts (vect_t in, vect_t inorm, vect_t out, int id, struct application *ap, FILE *fp)
 
void wraypaint (vect_t start, vect_t norm, int paint, struct application *ap, FILE *fp)
 

Detailed Description

Write a VLD-standard ray on the given file pointer. VLD-standard rays are defined by /vld/include/ray.h, included here for portability. A variety of VLD programs exist to manipulate these files, including rayvect.

To obtain a UNIX-plot of a ray file, the procedure is: rayvect -mMM < file.ray > file.vect vectplot -mMM < file.vect > file.plot3 tplot -Tmeg file.plot3 # or equivalent

Definition in file wray.c.

Macro Definition Documentation

#define WRAY_NORMAL (   _ray,
  _norm 
)
Value:
_ray.na = bn_atan2(_norm[Y], _norm[X]); \
_ray.ne = bn_atan2(_norm[Z], \
sqrt(_norm[X] * _norm[X] + _norm[Y] * _norm[Y]));
Definition: color.c:49
double bn_atan2(double x, double y)
Definition: mat.c:104
Definition: color.c:51
Definition: color.c:50

Definition at line 88 of file wray.c.

Referenced by wray(), wraypaint(), and wraypts().

#define WRAY_TAG (   _ray,
  _ap 
)
Value:
{ \
if ((_ray.rt = _ap->a_level) > 0x3F || _ray.rt < 0) \
_ray.rt = 0x3F; \
_ray.rt |= ((_ap->a_x & 0x1FFF) << 6) | \
((_ap->a_y & 0x1FFF) << (6+13)); \
}
if(share_geom)
Definition: nmg_mod.c:3829

Definition at line 109 of file wray.c.

Referenced by wray(), wraypaint(), and wraypts().