Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
P
PAP_ray_tracing
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Déploiement
Releases
Registre de conteneurs
Registre de modèles
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Yacine ACHEROUFKEBIR
PAP_ray_tracing
Validations
0b05c82c
Valider
0b05c82c
rédigé
Il y a 5 ans
par
DBA_3
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
reflexion
parent
3fabb6f3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
2.png
+0
-0
0 ajout, 0 suppression
2.png
main
+0
-0
0 ajout, 0 suppression
main
main.cpp
+1
-1
1 ajout, 1 suppression
main.cpp
scene.cpp
+6
-5
6 ajouts, 5 suppressions
scene.cpp
avec
7 ajouts
et
6 suppressions
2.png
+
0
−
0
Voir le fichier remplacé @
3fabb6f3
Voir le fichier @
0b05c82c
92,2 ko
|
W:
|
H:
94,4 ko
|
W:
|
H:
2-up
Swipe
Onion skin
Ce diff est replié.
Cliquez pour l'agrandir.
main
+
0
−
0
Voir le fichier @
0b05c82c
Aucun aperçu pour ce type de fichier
Ce diff est replié.
Cliquez pour l'agrandir.
main.cpp
+
1
−
1
Voir le fichier @
0b05c82c
...
@@ -150,7 +150,7 @@ int main()
...
@@ -150,7 +150,7 @@ int main()
Material
white
(
255
,
255
,
255
,
0
);
Material
white
(
255
,
255
,
255
,
0
);
Material
grey
(
122
,
122
,
122
,
0
);
Material
grey
(
122
,
122
,
122
,
0
);
Material
black
(
0
,
0
,
0
,
0
);
Material
black
(
0
,
0
,
0
,
0
);
Material
mirror
(
255
,
255
,
255
,
0.9
);
Material
mirror
(
0
,
0
,
0
,
0.9
);
int
nb_shapes
=
7
;
int
nb_shapes
=
7
;
float
width
=
100
;
//x
float
width
=
100
;
//x
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
scene.cpp
+
6
−
5
Voir le fichier @
0b05c82c
...
@@ -226,7 +226,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
...
@@ -226,7 +226,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
float
min_dist
;
float
min_dist
;
float
hit_dist
;
float
hit_dist
;
int
ref_max
=
3
;
int
ref_max
=
4
;
Ray3f
*
ray
[
ref_max
];
Ray3f
*
ray
[
ref_max
];
float
shine
[
ref_max
-
1
];
float
shine
[
ref_max
-
1
];
float
coef
[
ref_max
-
1
];
float
coef
[
ref_max
-
1
];
...
@@ -236,7 +236,6 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
...
@@ -236,7 +236,6 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
{
{
for
(
int
j
=
0
;
j
<
nb_pixel_row
;
j
++
)
for
(
int
j
=
0
;
j
<
nb_pixel_row
;
j
++
)
{
{
min_dist
=
1000
;
Vector3f
Pij
(
j
*
pw
,
i
*
ph
,
0
);
//point de la grille par laquelle on regarde
Vector3f
Pij
(
j
*
pw
,
i
*
ph
,
0
);
//point de la grille par laquelle on regarde
Ray3f
camera_to_grid
(
camera_
.
position
(),
Pij
-
camera_
.
position
());
Ray3f
camera_to_grid
(
camera_
.
position
(),
Pij
-
camera_
.
position
());
ray
[
0
]
=
new
Ray3f
(
camera_to_grid
);
ray
[
0
]
=
new
Ray3f
(
camera_to_grid
);
...
@@ -244,20 +243,19 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
...
@@ -244,20 +243,19 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
nb_reflected
(
ray
,
nb_shapes
,
ref_max
,
shine
);
nb_reflected
(
ray
,
nb_shapes
,
ref_max
,
shine
);
coeff
(
shine
,
coef
,
ref_max
);
coeff
(
shine
,
coef
,
ref_max
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
0
;
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
0
;
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
0
;
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
0
;
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
0
;
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
0
;
for
(
int
r
=
0
;
r
<
ref_max
-
1
;
r
++
)
for
(
int
r
=
0
;
r
<
ref_max
-
1
;
r
++
)
{
{
min_dist
=
1000
;
for
(
int
k
=
0
;
k
<
nb_shapes
;
k
++
)
for
(
int
k
=
0
;
k
<
nb_shapes
;
k
++
)
{
{
if
(
shapes_
[
k
]
->
is_hit
(
*
ray
[
r
]))
if
(
shapes_
[
k
]
->
is_hit
(
*
ray
[
r
]))
{
{
Ray3f
reflected
(
shapes_
[
k
]
->
reflect
(
*
ray
[
r
]));
Ray3f
reflected
(
shapes_
[
k
]
->
reflect
(
*
ray
[
r
]));
hit_dist
=
dist
(
reflected
.
origin
()
,
camera_
.
positio
n
());
hit_dist
=
dist
(
reflected
.
origin
()
,
ray
[
r
]
->
origi
n
());
if
(
hit_dist
<
min_dist
)
//on regarde l'objet le plus proche de la caméra
if
(
hit_dist
<
min_dist
)
//on regarde l'objet le plus proche de la caméra
{
{
...
@@ -288,6 +286,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
...
@@ -288,6 +286,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
+
coef
[
r
]
*
fmin
(
50
,
50
*
intensity
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
+
coef
[
r
]
*
fmin
(
50
,
50
*
intensity
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
+
coef
[
r
]
*
fmin
(
50
,
50
*
intensity
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
+
coef
[
r
]
*
fmin
(
50
,
50
*
intensity
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
+
coef
[
r
]
*
fmin
(
50
,
50
*
intensity
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
+
coef
[
r
]
*
fmin
(
50
,
50
*
intensity
);
}
}
else
else
...
@@ -301,6 +300,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
...
@@ -301,6 +300,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
r
()
/
2.
*
intensity
,
shapes_
[
k
]
->
matter
().
r
()
/
2.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
r
()
/
2.
*
intensity
,
shapes_
[
k
]
->
matter
().
r
()
/
2.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
g
()
/
2.
*
intensity
,
shapes_
[
k
]
->
matter
().
g
()
/
2.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
g
()
/
2.
*
intensity
,
shapes_
[
k
]
->
matter
().
g
()
/
2.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
b
()
/
2.
*
intensity
,
shapes_
[
k
]
->
matter
().
b
()
/
2.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
b
()
/
2.
*
intensity
,
shapes_
[
k
]
->
matter
().
b
()
/
2.
);
}
}
else
//il faut rajouter la réflexion et l'angle
else
//il faut rajouter la réflexion et l'angle
...
@@ -308,6 +308,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
...
@@ -308,6 +308,7 @@ void Scene::render(int width, int height, int nb_pixel_row, int nb_pixel_col, in
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
r
()
*
intensity
,
255.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
r
()
*
intensity
,
255.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
g
()
*
intensity
,
255.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
1
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
g
()
*
intensity
,
255.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
b
()
*
intensity
,
255.
);
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
=
row
[
3
*
(
nb_pixel_row
-
1
-
j
)
+
2
]
+
coef
[
r
]
*
fmin
(
shapes_
[
k
]
->
matter
().
b
()
*
intensity
,
255.
);
}
}
}
}
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter