Reusser wrote:
> Hey,
> I know this will probably sound like a dumb question to all of the
> programmers in here, but I'm completely new to C++ and I'm pretty
> confused. I found a vector class online but I don't know quite how to
> use it. Every time I try, I get more errors than there are lines of
> text. How would I define a simple 3d vector like I would in POV so I
> can do basic operations on it? Thanks in advance.
The vector class (or rather the vector *template*) that comes with the
standard library is useful for holding a dynamical number of entries. For a
simple 3d vector use an array as in C - or if you want to do it
object-orientated write a Vector class around it.
As example the class I have written for my raytracer for that purpose:
http://www.povworld.org/raytracer/api/raytracer___vector_h.html
--
objects.povworld.org - The POV-Ray Objects Collection
book.povworld.org - The POV-Ray Book Project
Post a reply to this message
|