From 1374b946398544a28ac989c75570d4b7c6937873 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 14 Sep 2011 18:56:08 -0400 Subject: Transform normals as pseudovectors, not vectors. Also clarify the vector transformation API. Instead of dmnsn_transform_vector(), we have: - dmnsn_transform_point() - dmnsn_transform_direction() - dmnsn_transform_normal() --- libdimension/bench/geometry.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'libdimension/bench') diff --git a/libdimension/bench/geometry.c b/libdimension/bench/geometry.c index a952631..4b8c12a 100644 --- a/libdimension/bench/geometry.c +++ b/libdimension/bench/geometry.c @@ -1,5 +1,5 @@ /************************************************************************* - * Copyright (C) 2009-2010 Tavian Barnes * + * Copyright (C) 2009-2011 Tavian Barnes * * * * This file is part of The Dimension Benchmark Suite. * * * @@ -149,11 +149,23 @@ main(void) }); printf("dmnsn_matrix_mul(): %ld\n", sandglass.grains); - /* dmnsn_transform_vector() */ + /* dmnsn_transform_point() */ sandglass_bench_fine(&sandglass, { - vector = dmnsn_transform_vector(matrix, vector); + vector = dmnsn_transform_point(matrix, vector); }); - printf("dmnsn_transform_vector(): %ld\n", sandglass.grains); + printf("dmnsn_transform_point(): %ld\n", sandglass.grains); + + /* dmnsn_transform_direction() */ + sandglass_bench_fine(&sandglass, { + vector = dmnsn_transform_direction(matrix, vector); + }); + printf("dmnsn_transform_direction(): %ld\n", sandglass.grains); + + /* dmnsn_transform_normal() */ + sandglass_bench_fine(&sandglass, { + vector = dmnsn_transform_normal(matrix, vector); + }); + printf("dmnsn_transform_normal(): %ld\n", sandglass.grains); /* dmnsn_transform_line() */ sandglass_bench_fine(&sandglass, { -- cgit v1.2.3