added --help option, updated util/Transform

git-svn-id: svn://anubis/fart/trunk@26 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-01-22 03:28:51 +00:00
parent 5692558733
commit 1454fe8c2e
3 changed files with 23 additions and 7 deletions

View File

@ -28,6 +28,7 @@ int main(int argc, char * argv[])
map<string, const char *> scene_options;
static const struct option long_options[] = {
{ "help", no_argument, NULL, 256 },
{ "output-file", required_argument, NULL, 'o' },
{ "width", required_argument, NULL, 'w' },
{ "height", required_argument, NULL, 'h' },
@ -41,6 +42,9 @@ int main(int argc, char * argv[])
{
switch (opt)
{
case 256:
usage(argv[0]);
break;
case 'o':
scene_options["output-file"] = optarg;
break;

View File

@ -1,12 +1,22 @@
#include "Transform.h"
void Transform::push()
Transform::Transform()
{
m_matrices.push(m_matrices.top());
m_matrix = Matrix::identity();
}
void Transform::pop()
void Transform::translate(double x, double y, double z)
{
m_matrices.pop();
/* TODO: fill in */
}
void Transform::rotate(double amt, double xv, double yv, double zv)
{
/* TODO: fill in */
}
void Transform::scale(double xs, double ys, double zs)
{
/* TODO: fill in */
}

View File

@ -8,11 +8,13 @@
class Transform
{
public:
void push();
void pop();
Transform();
void translate(double x, double y, double z);
void rotate(double amt, double xv, double yv, double zv);
void scale(double xs, double ys, double zs);
protected:
std::stack<Matrix> m_matrices;
Matrix m_matrix;
};
#endif