Loading LrBinderRegularGrid.cpp +23 −9 Changes for LrBinderRegularGrid.cpp: 23 added lines, 9 removed lines. Original line number Diff line number Diff line /* @brief OBJET : represente la structure acceleratrice simple (une simple boite)atrice * @file LrBinderRegularGrid.h /** * @brief OBJET : represente la structure acceleratrice simple (une simple boite) * @file LrBindeRegularGrid.h * @date Lundi 10 Mars 2008 * @note * @author Josselin Francois Loading @@ -8,7 +9,7 @@ * @author Hervé Souchaud * @author Emeric Verschuur * * Ce fichier contient la classe qui gère la creation d'une structure acceleratrice simple pour la gestion des objets 3D * Ce fichier contient la classe qui gère la creation d'une structure acceleratrice de type Grille régulière */ #if defined HAVE_CONFIG_H Loading @@ -27,13 +28,14 @@ using namespace std; // ############################################################################ LrBinderRegularGrid::LrBinderRegularGrid() : LrBinder() { //initBinder(); } // ############################################################################ LrBinderRegularGrid::LrBinderRegularGrid(const LrBinderRegularGrid & source) : LrBinder(source), Loading @@ -46,7 +48,7 @@ m_tabVoxel(source.m_tabVoxel) { //initBinder(); } // ############################################################################ LrBinderRegularGrid::LrBinderRegularGrid(const LrEntityList &entities, int nbVoxelX, int nbVoxelY, int nbVoxelZ) : LrBinder(entities), Loading @@ -66,13 +68,12 @@ m_tabVoxel(nbVoxelX*nbVoxelY*nbVoxelZ) //initBinder(); } // ############################################################################ LrBinderRegularGrid::~LrBinderRegularGrid() { } // ############################################################################ void LrBinderRegularGrid::initBinder() { Loading Loading @@ -101,13 +102,25 @@ void LrBinderRegularGrid::initBinder() } <<<<<<< .mine min.x -= 4 *EPSILON; min.y -= 4 *EPSILON; min.z -= 4 *EPSILON; ======= min.x -= 2 * EPSILON; min.y -= 2 * EPSILON; min.z -= 2 * EPSILON; >>>>>>> .r533 <<<<<<< .mine max.x += 4 *EPSILON; max.y += 4 *EPSILON; max.z += 4 *EPSILON; ======= max.x += 2 * EPSILON; max.y += 2 * EPSILON; max.z += 2 * EPSILON; >>>>>>> .r533 m_lenBinder = LrVector(min,max); Loading Loading @@ -154,7 +167,7 @@ void LrBinderRegularGrid::initBinder() } } // ############################################################################ bool LrBinderRegularGrid::getIntersection(const LrRay &ray, LrHit *hit, Real minbound, Real maxbound) const { Real lminbound, lmaxbound; Loading Loading @@ -515,3 +528,4 @@ bool LrBinderRegularGrid::getIntersection(const LrRay &ray, LrHit *hit, Real min return false; } // ############################################################################ No newline at end of file LrPerlin.cpp +10 −9 Changes for LrPerlin.cpp: 10 added lines, 9 removed lines. Original line number Diff line number Diff line /** * @brief PertNormal : les perturbations de normal d'une optic. * @brief Classe gere le bruit de perlin * @file LrPerlin.cpp * @date Jeudi 14 Fevrier 2008 * @date Jeudi 1 mai 2008 * @note * @author Josselin Francois * @author Michael Nauge Loading Loading @@ -39,24 +39,24 @@ static int permutation[] = { 151,160,137,91,90,15, 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180 }; /*****************************************************************************/ // ############################################################################ LrPerlin::LrPerlin() { for (int i=0; i < 256 ; i++) { p[256+i] = p[i] = permutation[i]; } } /*****************************************************************************/ // ############################################################################ double LrPerlin::fade(double t) { return t * t * t * (t * (t * 6 - 15) + 10); } /*****************************************************************************/ // ############################################################################ double LrPerlin::lerp(double t, double a, double b) { return a + t * (b - a); } /*****************************************************************************/ // ############################################################################ double LrPerlin::grad(int hash, double x, double y, double z) { int h = hash & 15; // CONVERT LO 4 BITS OF HASH CODE Loading @@ -64,12 +64,12 @@ double LrPerlin::grad(int hash, double x, double y, double z) v = h<4||h==12||h==13 ? y : z; return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v); } /*****************************************************************************/ // ############################################################################ Real LrPerlin::f_noise(Real x, Real y, Real z) { return (Real)d_noise((double)x, (double)y, (double)z); } /*****************************************************************************/ // ############################################################################ double LrPerlin::d_noise(double x, double y, double z) { int X = (int)floor(x) & 255, // FIND UNIT CUBE THAT Loading @@ -93,7 +93,7 @@ double LrPerlin::d_noise(double x, double y, double z) lerp(u, grad(p[AB+1], x, y-1, z-1), grad(p[BB+1], x-1, y-1, z-1)))); } /*****************************************************************************/ // ############################################################################ Real LrPerlin::lissage(Real x, Real y, Real z) { Real corners = ( f_noise(x-1, y-1, z-1) Loading @@ -113,3 +113,4 @@ Real LrPerlin::lissage(Real x, Real y, Real z) return corners + sides + center; } // ############################################################################ LrPerlin.h +24 −10 Changes for LrPerlin.h: 24 added lines, 10 removed lines. Original line number Diff line number Diff line /** * @brief Classe gere le bruit de perlin * @file LrPerlin.h * @date Jeudi 1 mai 2008 * @note * @author Josselin Francois * @author Michael Nauge * @author Axel Richard * @author Hervé Souchaud * @author Emeric Verschuur * * Classe permettant d'utiliser le bruit de perlin * pour générer des textures ou des perturbations de normal */ #ifndef LRPERLIN_H #define LRPERLIN_H Loading @@ -8,28 +22,28 @@ class LrPerlin LrPerlin(); /** version de d_noise avec des float */ /** @brief version de d_noise avec des float */ Real f_noise(Real x, Real y, Real z); Real lissage(Real x, Real y, Real z); private : /** matrice du bruit de perlin pour la texture en calcule */ /** @brief matrice du bruit de perlin pour la texture en calcule */ int p[512]; /** fonction pour le calcul du bruit /** @brief fonction pour le calcul du bruit * @see http://mrl.nyu.edu/~perlin */ double fade(double t); /** fonction pour le calcul du bruit /** @brief fonction pour le calcul du bruit * @see http://mrl.nyu.edu/~perlin */ double lerp(double t, double a, double b); /** fonction pour le calcul du gradien /** @brief fonction pour le calcul du gradien * @see http://mrl.nyu.edu/~perlin */ double grad(int hash, double x, double y, double z); /** methode de Perlin créant un bruit dit cohérent sur l'image (ici le pixel traité par rapport a son voisinage) * la methode renvoie une valeur représentant le niveau de bruit pour le point en traitement * cette est appelée le coefficient de Perlin * cette methode doit etre récupérée sur le site de Ken Perlin, * il s'agit ici de la version C++ (la version de base est en JAVA) /** @brief methode de Perlin créant un bruit dit cohérent sur l'image (ici le pixel traité par rapport a son voisinage) * @brief la methode renvoie une valeur représentant le niveau de bruit pour le point en traitement * @brief cette est appelée le coefficient de Perlin * @brief cette methode doit etre récupérée sur le site de Ken Perlin, * @brief il s'agit ici de la version C++ (la version de base est en JAVA) * @param x : coordonnée x du point en traitement * @param y ; coordonnée y du point en traitement * @param z : coordonnée z du point en traitement Loading LrPertColor3DDamier.cpp +10 −14 Changes for LrPertColor3DDamier.cpp: 10 added lines, 14 removed lines. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ * @author Emeric Verschuur * * * Classe représentant une perturbation de couleur par une texture * Classe représentant une perturbation de couleur pour l'application d'une texture Damier * */ Loading @@ -25,7 +25,7 @@ /*---------------------------------------------------------------------------* * constructors and destructor * *---------------------------------------------------------------------------*/ // ############################################################################ LrPertColor3DDamier::LrPertColor3DDamier() : LrPertColorTextProc3D(), dim(0.0) Loading @@ -38,25 +38,27 @@ LrPertColor3DDamier::LrPertColor3DDamier(const LrPertColor3DDamier &source) { } // ############################################################################ LrPertColor3DDamier::LrPertColor3DDamier(const LrColor &c1, const LrColor &c2, Real dimension) : LrPertColorTextProc3D(c1, c2, c2), dim(dimension) { } // ############################################################################ LrPertColor3DDamier * LrPertColor3DDamier::clone() const { return new LrPertColor3DDamier(*this); } // ############################################################################ LrPertColor3DDamier::~LrPertColor3DDamier() { } // ############################################################################ /*---------------------------------------------------------------------------* * assignement operator(s) * *---------------------------------------------------------------------------*/ // ############################################################################ LrPertColor3DDamier& LrPertColor3DDamier::operator = (const LrPertColor3DDamier &source) { if (this == &source) Loading @@ -66,11 +68,11 @@ LrPertColor3DDamier& LrPertColor3DDamier::operator = (const LrPertColor3DDamier dim = source.dim; return *this; } // ############################################################################ /*---------------------------------------------------------------------------* * comparison operator(s) * *---------------------------------------------------------------------------*/ // ############################################################################ bool operator == (const LrPertColor3DDamier &lhs, const LrPertColor3DDamier &rhs) { return (LrPertColorTextProc3D&)lhs==(LrPertColorTextProc3D&)rhs && lhs.dim == rhs.dim ; Loading Loading @@ -108,10 +110,4 @@ LrColor LrPertColor3DDamier:: getColor(Real u, Real v, LrPoint &point) const else if( (x_pair && z_pair) || (!x_pair && !z_pair) ) return C2; else return C1; } // ############################################################################ LrPertColor3DDamier.h +8 −12 Changes for LrPertColor3DDamier.h: 8 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ * @author Emeric Verschuur * * * Classe représentant une perturbation de couleur par une texture procedurale * Classe représentant une perturbation de couleur pour l'application d'une texture Damier * */ Loading @@ -19,24 +19,19 @@ #include "LrPertColorTextProc3D.h" /** * @brief PertColor : les perturbations de couleur d'une optic. * * Classe représentant une perturbation de couleur par une texture procedurale */ class LrPertColor3DDamier : public LrPertColorTextProc3D { public: /** @brief constructeur par défaut */ LrPertColor3DDamier(); /** * @brief LrPertColorTextProcDmaier copy constructor * @brief LrPertColor3DDamier copy constructor * @param source LrPertColorTextProcDmaier object reference. */ LrPertColor3DDamier(const LrPertColor3DDamier &source); /** * @brief LrPertColorTextProcDmaier personnal constructor * @brief LrPertColor3DDamier personnal constructor * @param c1 couleur 1 de la texture * @param c2 couleur 2 de la texture * @param c3 couleur 3 de la texture. Loading @@ -46,13 +41,13 @@ class LrPertColor3DDamier : public LrPertColorTextProc3D /** * @brief LrPertColorTexture clone. * @return LrPertColorTexture pointer object. * @brief LrPertColor3DDamier clone. * @return LrPertColor3DDamier pointer object. */ LrPertColor3DDamier * clone() const; /** * @brief LrPertColorTexture destructor * @brief LrPertColor3DDamier destructor */ virtual ~LrPertColor3DDamier(); Loading @@ -74,6 +69,7 @@ class LrPertColor3DDamier : public LrPertColorTextProc3D LrColor getColor(Real u, Real v, LrPoint &point) const; protected : /** @brief la dimension d'un damier */ Real dim; }; Loading Loading
LrBinderRegularGrid.cpp +23 −9 Changes for LrBinderRegularGrid.cpp: 23 added lines, 9 removed lines. Original line number Diff line number Diff line /* @brief OBJET : represente la structure acceleratrice simple (une simple boite)atrice * @file LrBinderRegularGrid.h /** * @brief OBJET : represente la structure acceleratrice simple (une simple boite) * @file LrBindeRegularGrid.h * @date Lundi 10 Mars 2008 * @note * @author Josselin Francois Loading @@ -8,7 +9,7 @@ * @author Hervé Souchaud * @author Emeric Verschuur * * Ce fichier contient la classe qui gère la creation d'une structure acceleratrice simple pour la gestion des objets 3D * Ce fichier contient la classe qui gère la creation d'une structure acceleratrice de type Grille régulière */ #if defined HAVE_CONFIG_H Loading @@ -27,13 +28,14 @@ using namespace std; // ############################################################################ LrBinderRegularGrid::LrBinderRegularGrid() : LrBinder() { //initBinder(); } // ############################################################################ LrBinderRegularGrid::LrBinderRegularGrid(const LrBinderRegularGrid & source) : LrBinder(source), Loading @@ -46,7 +48,7 @@ m_tabVoxel(source.m_tabVoxel) { //initBinder(); } // ############################################################################ LrBinderRegularGrid::LrBinderRegularGrid(const LrEntityList &entities, int nbVoxelX, int nbVoxelY, int nbVoxelZ) : LrBinder(entities), Loading @@ -66,13 +68,12 @@ m_tabVoxel(nbVoxelX*nbVoxelY*nbVoxelZ) //initBinder(); } // ############################################################################ LrBinderRegularGrid::~LrBinderRegularGrid() { } // ############################################################################ void LrBinderRegularGrid::initBinder() { Loading Loading @@ -101,13 +102,25 @@ void LrBinderRegularGrid::initBinder() } <<<<<<< .mine min.x -= 4 *EPSILON; min.y -= 4 *EPSILON; min.z -= 4 *EPSILON; ======= min.x -= 2 * EPSILON; min.y -= 2 * EPSILON; min.z -= 2 * EPSILON; >>>>>>> .r533 <<<<<<< .mine max.x += 4 *EPSILON; max.y += 4 *EPSILON; max.z += 4 *EPSILON; ======= max.x += 2 * EPSILON; max.y += 2 * EPSILON; max.z += 2 * EPSILON; >>>>>>> .r533 m_lenBinder = LrVector(min,max); Loading Loading @@ -154,7 +167,7 @@ void LrBinderRegularGrid::initBinder() } } // ############################################################################ bool LrBinderRegularGrid::getIntersection(const LrRay &ray, LrHit *hit, Real minbound, Real maxbound) const { Real lminbound, lmaxbound; Loading Loading @@ -515,3 +528,4 @@ bool LrBinderRegularGrid::getIntersection(const LrRay &ray, LrHit *hit, Real min return false; } // ############################################################################ No newline at end of file
LrPerlin.cpp +10 −9 Changes for LrPerlin.cpp: 10 added lines, 9 removed lines. Original line number Diff line number Diff line /** * @brief PertNormal : les perturbations de normal d'une optic. * @brief Classe gere le bruit de perlin * @file LrPerlin.cpp * @date Jeudi 14 Fevrier 2008 * @date Jeudi 1 mai 2008 * @note * @author Josselin Francois * @author Michael Nauge Loading Loading @@ -39,24 +39,24 @@ static int permutation[] = { 151,160,137,91,90,15, 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180 }; /*****************************************************************************/ // ############################################################################ LrPerlin::LrPerlin() { for (int i=0; i < 256 ; i++) { p[256+i] = p[i] = permutation[i]; } } /*****************************************************************************/ // ############################################################################ double LrPerlin::fade(double t) { return t * t * t * (t * (t * 6 - 15) + 10); } /*****************************************************************************/ // ############################################################################ double LrPerlin::lerp(double t, double a, double b) { return a + t * (b - a); } /*****************************************************************************/ // ############################################################################ double LrPerlin::grad(int hash, double x, double y, double z) { int h = hash & 15; // CONVERT LO 4 BITS OF HASH CODE Loading @@ -64,12 +64,12 @@ double LrPerlin::grad(int hash, double x, double y, double z) v = h<4||h==12||h==13 ? y : z; return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v); } /*****************************************************************************/ // ############################################################################ Real LrPerlin::f_noise(Real x, Real y, Real z) { return (Real)d_noise((double)x, (double)y, (double)z); } /*****************************************************************************/ // ############################################################################ double LrPerlin::d_noise(double x, double y, double z) { int X = (int)floor(x) & 255, // FIND UNIT CUBE THAT Loading @@ -93,7 +93,7 @@ double LrPerlin::d_noise(double x, double y, double z) lerp(u, grad(p[AB+1], x, y-1, z-1), grad(p[BB+1], x-1, y-1, z-1)))); } /*****************************************************************************/ // ############################################################################ Real LrPerlin::lissage(Real x, Real y, Real z) { Real corners = ( f_noise(x-1, y-1, z-1) Loading @@ -113,3 +113,4 @@ Real LrPerlin::lissage(Real x, Real y, Real z) return corners + sides + center; } // ############################################################################
LrPerlin.h +24 −10 Changes for LrPerlin.h: 24 added lines, 10 removed lines. Original line number Diff line number Diff line /** * @brief Classe gere le bruit de perlin * @file LrPerlin.h * @date Jeudi 1 mai 2008 * @note * @author Josselin Francois * @author Michael Nauge * @author Axel Richard * @author Hervé Souchaud * @author Emeric Verschuur * * Classe permettant d'utiliser le bruit de perlin * pour générer des textures ou des perturbations de normal */ #ifndef LRPERLIN_H #define LRPERLIN_H Loading @@ -8,28 +22,28 @@ class LrPerlin LrPerlin(); /** version de d_noise avec des float */ /** @brief version de d_noise avec des float */ Real f_noise(Real x, Real y, Real z); Real lissage(Real x, Real y, Real z); private : /** matrice du bruit de perlin pour la texture en calcule */ /** @brief matrice du bruit de perlin pour la texture en calcule */ int p[512]; /** fonction pour le calcul du bruit /** @brief fonction pour le calcul du bruit * @see http://mrl.nyu.edu/~perlin */ double fade(double t); /** fonction pour le calcul du bruit /** @brief fonction pour le calcul du bruit * @see http://mrl.nyu.edu/~perlin */ double lerp(double t, double a, double b); /** fonction pour le calcul du gradien /** @brief fonction pour le calcul du gradien * @see http://mrl.nyu.edu/~perlin */ double grad(int hash, double x, double y, double z); /** methode de Perlin créant un bruit dit cohérent sur l'image (ici le pixel traité par rapport a son voisinage) * la methode renvoie une valeur représentant le niveau de bruit pour le point en traitement * cette est appelée le coefficient de Perlin * cette methode doit etre récupérée sur le site de Ken Perlin, * il s'agit ici de la version C++ (la version de base est en JAVA) /** @brief methode de Perlin créant un bruit dit cohérent sur l'image (ici le pixel traité par rapport a son voisinage) * @brief la methode renvoie une valeur représentant le niveau de bruit pour le point en traitement * @brief cette est appelée le coefficient de Perlin * @brief cette methode doit etre récupérée sur le site de Ken Perlin, * @brief il s'agit ici de la version C++ (la version de base est en JAVA) * @param x : coordonnée x du point en traitement * @param y ; coordonnée y du point en traitement * @param z : coordonnée z du point en traitement Loading
LrPertColor3DDamier.cpp +10 −14 Changes for LrPertColor3DDamier.cpp: 10 added lines, 14 removed lines. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ * @author Emeric Verschuur * * * Classe représentant une perturbation de couleur par une texture * Classe représentant une perturbation de couleur pour l'application d'une texture Damier * */ Loading @@ -25,7 +25,7 @@ /*---------------------------------------------------------------------------* * constructors and destructor * *---------------------------------------------------------------------------*/ // ############################################################################ LrPertColor3DDamier::LrPertColor3DDamier() : LrPertColorTextProc3D(), dim(0.0) Loading @@ -38,25 +38,27 @@ LrPertColor3DDamier::LrPertColor3DDamier(const LrPertColor3DDamier &source) { } // ############################################################################ LrPertColor3DDamier::LrPertColor3DDamier(const LrColor &c1, const LrColor &c2, Real dimension) : LrPertColorTextProc3D(c1, c2, c2), dim(dimension) { } // ############################################################################ LrPertColor3DDamier * LrPertColor3DDamier::clone() const { return new LrPertColor3DDamier(*this); } // ############################################################################ LrPertColor3DDamier::~LrPertColor3DDamier() { } // ############################################################################ /*---------------------------------------------------------------------------* * assignement operator(s) * *---------------------------------------------------------------------------*/ // ############################################################################ LrPertColor3DDamier& LrPertColor3DDamier::operator = (const LrPertColor3DDamier &source) { if (this == &source) Loading @@ -66,11 +68,11 @@ LrPertColor3DDamier& LrPertColor3DDamier::operator = (const LrPertColor3DDamier dim = source.dim; return *this; } // ############################################################################ /*---------------------------------------------------------------------------* * comparison operator(s) * *---------------------------------------------------------------------------*/ // ############################################################################ bool operator == (const LrPertColor3DDamier &lhs, const LrPertColor3DDamier &rhs) { return (LrPertColorTextProc3D&)lhs==(LrPertColorTextProc3D&)rhs && lhs.dim == rhs.dim ; Loading Loading @@ -108,10 +110,4 @@ LrColor LrPertColor3DDamier:: getColor(Real u, Real v, LrPoint &point) const else if( (x_pair && z_pair) || (!x_pair && !z_pair) ) return C2; else return C1; } // ############################################################################
LrPertColor3DDamier.h +8 −12 Changes for LrPertColor3DDamier.h: 8 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ * @author Emeric Verschuur * * * Classe représentant une perturbation de couleur par une texture procedurale * Classe représentant une perturbation de couleur pour l'application d'une texture Damier * */ Loading @@ -19,24 +19,19 @@ #include "LrPertColorTextProc3D.h" /** * @brief PertColor : les perturbations de couleur d'une optic. * * Classe représentant une perturbation de couleur par une texture procedurale */ class LrPertColor3DDamier : public LrPertColorTextProc3D { public: /** @brief constructeur par défaut */ LrPertColor3DDamier(); /** * @brief LrPertColorTextProcDmaier copy constructor * @brief LrPertColor3DDamier copy constructor * @param source LrPertColorTextProcDmaier object reference. */ LrPertColor3DDamier(const LrPertColor3DDamier &source); /** * @brief LrPertColorTextProcDmaier personnal constructor * @brief LrPertColor3DDamier personnal constructor * @param c1 couleur 1 de la texture * @param c2 couleur 2 de la texture * @param c3 couleur 3 de la texture. Loading @@ -46,13 +41,13 @@ class LrPertColor3DDamier : public LrPertColorTextProc3D /** * @brief LrPertColorTexture clone. * @return LrPertColorTexture pointer object. * @brief LrPertColor3DDamier clone. * @return LrPertColor3DDamier pointer object. */ LrPertColor3DDamier * clone() const; /** * @brief LrPertColorTexture destructor * @brief LrPertColor3DDamier destructor */ virtual ~LrPertColor3DDamier(); Loading @@ -74,6 +69,7 @@ class LrPertColor3DDamier : public LrPertColorTextProc3D LrColor getColor(Real u, Real v, LrPoint &point) const; protected : /** @brief la dimension d'un damier */ Real dim; }; Loading