Commit 2b0fd438 authored by axel's avatar axel

maintenant , le random marche normalement (normalement...)

parent 834d9e84
......@@ -22,12 +22,10 @@
#include <iostream>
static float randMinMax(float min, float max)
{
return (1.0 * rand()/RAND_MAX)*0.5;
}
//static float randMinMax(float min, float max)
//{
// return (1.0 * rand()/RAND_MAX)*;
//}
/*---------------------------------------------------------------------------*
* constructors and destructor *
......@@ -56,16 +54,16 @@ void LrAntiAliasingRandom::getCoordUV(const int coeffAA, const int numCase, Real
//le pas
float pas = (1.0/(coeffAA*2));
std::cout<<"pas : "<<pas<<std::endl;
//std::cout<<"pas : "<<pas<<std::endl;
//Le num de ligne et de colonne
int numLigne = (int)(floor(numCase / coeffAA)+1);
int numColonne = (int)(floor(numCase % coeffAA)+1);
//random de -pas a pas
float variation = (1.0 * rand()/RAND_MAX) * (pas*2);
float variation = -pas + (1.0 * rand()/RAND_MAX) * (pas*2);
//std::cout<<"variation : "<<variation<<std::endl;
std::cout<<variation<<" ";
// tirer u et v aleatoirement dans le pixel ou le sous-pixel
(*u) = (pas * ((numColonne*2)-1)) + variation;
(*v) = (pas * ((numLigne*2)-1)) + variation;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment