add parabole
This commit is contained in:
parent
2c525cb5e0
commit
a89bea929a
6 changed files with 447 additions and 32 deletions
|
|
@ -61,6 +61,7 @@ void mat3_rotate_z(Matrix3 *m, int angle) {
|
|||
}
|
||||
|
||||
/* Fait pivoter la géométrie locale de l'objet de façon permanente */
|
||||
/*
|
||||
void bake_object_rotation(Universe *uni, Object3D *obj, int ax, int ay, int az) {
|
||||
Matrix3 rx, ry, rz, tmp, rot;
|
||||
Vector3 *v, *n;
|
||||
|
|
@ -70,20 +71,20 @@ void bake_object_rotation(Universe *uni, Object3D *obj, int ax, int ay, int az)
|
|||
|
||||
if (!obj || !uni) return;
|
||||
|
||||
/* Composition de la matrice de rotation */
|
||||
/* Composition de la matrice de rotation * /
|
||||
mat3_rotate_x(&rx, ax);
|
||||
mat3_rotate_y(&ry, ay);
|
||||
mat3_rotate_z(&rz, az);
|
||||
mat3_mul(&tmp, &rx, &ry);
|
||||
mat3_mul(&rot, &tmp, &rz);
|
||||
|
||||
/* Application à tous les sommets et normales de l'objet */
|
||||
/* Application à tous les sommets et normales de l'objet * /
|
||||
for (i = 0; i < obj->num_verts; i++) {
|
||||
vi = obj->vert_start + i;
|
||||
v = &uni->verts[vi];
|
||||
n = &uni->v_normals[vi];
|
||||
|
||||
/* Sommets */
|
||||
/* Sommets * /
|
||||
vx = f_mul(v->x, rot.m[0][0]) + f_mul(v->y, rot.m[1][0]) + f_mul(v->z, rot.m[2][0]);
|
||||
vy = f_mul(v->x, rot.m[0][1]) + f_mul(v->y, rot.m[1][1]) + f_mul(v->z, rot.m[2][1]);
|
||||
vz = f_mul(v->x, rot.m[0][2]) + f_mul(v->y, rot.m[1][2]) + f_mul(v->z, rot.m[2][2]);
|
||||
|
|
@ -91,7 +92,7 @@ void bake_object_rotation(Universe *uni, Object3D *obj, int ax, int ay, int az)
|
|||
v->y = vy;
|
||||
v->z = vz;
|
||||
|
||||
/* Normales (doivent aussi pivoter pour l'ombrage Gouraud !) */
|
||||
/* Normales (doivent aussi pivoter pour l'ombrage Gouraud !) * /
|
||||
vx = f_mul(n->x, rot.m[0][0]) + f_mul(n->y, rot.m[1][0]) + f_mul(n->z, rot.m[2][0]);
|
||||
vy = f_mul(n->x, rot.m[0][1]) + f_mul(n->y, rot.m[1][1]) + f_mul(n->z, rot.m[2][1]);
|
||||
vz = f_mul(n->x, rot.m[0][2]) + f_mul(n->y, rot.m[1][2]) + f_mul(n->z, rot.m[2][2]);
|
||||
|
|
@ -100,7 +101,7 @@ void bake_object_rotation(Universe *uni, Object3D *obj, int ax, int ay, int az)
|
|||
n->z = vz;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
void render_universe(Universe *uni, Camera *cam, int mode) {
|
||||
int o, i, vi, front;
|
||||
fixed rx, ry, rz, pz, nz;
|
||||
|
|
|
|||
Loading…
Reference in a new issue