コード例 #1
0
      ac->curve_point_count = 0;

    // MàJ globale de la courbe d'approximation
    ac_update_curve(ac);
  }
}

CLASSE(approximation_curve, struct approximation_curve,

       CHAMP(points,
	     LABEL("Points à approximer")
	     L_table_point P_table_triplet
	     Extrait Obligatoire Affiche Edite Sauve)
       CHAMP(degree,
	     LABEL("Degré de la courbe d'approximation")
	     L_entier  Edite Sauve DEFAUT("10"))
       CHAMP(use_uniform_parameterization,
	     LABEL("Paramétrage uniforme")
	     L_booleen Edite DEFAUT("1"))
       CHAMP(curve_point_count,
	     LABEL("Nombre de points à afficher")
	     L_entier  Edite Sauve DEFAUT("10"))

       CHANGEMENT(update)

       CHAMP_VIRTUEL(L_affiche_gl(approximation_curve_rendering))

       MENU("Jo/Approximation Bézier")

       EVENEMENT("Ctrl+RB")
       )
コード例 #2
0
ファイル: o_sph.c プロジェクト: Apolerag/MG
   {
     if (o->nb_point_affiche != o->affichage.nb_lignes)
       {
        for (i=0 ; i<o->affichage.nb_lignes ; i++)
          free(o->affichage.grille[i]);
        free(o->affichage.grille);
       }
        
        o->affichage = calcul_sphere(o->centre, o->rayon , o->nb_point_affiche);
        
   }
       
}



CLASSE(Sphere, struct sphere,
      
       CHAMP(affichage, L_grille_point P_grille_triplet Affiche) 
      
       CHAMP_VIRTUEL(L_affiche_gl(affiche_sphere))

       CHAMP(centre, L_triplet  Extrait Edite Sauve DEFAUT("0 0 0"))
       CHAMP(rayon, L_flottant  Edite Sauve DEFAUT("1"))    
       CHAMP(nb_point_affiche, L_entier Edite Sauve DEFAUT("10"))


       CHANGEMENT(changement)
       MENU("Exemples_MG/Sphere")
       EVENEMENT("Shft+SP")
       )
コード例 #3
0
ファイル: o_bezier.c プロジェクト: Apolerag/MG
		glVertex3f(b->pt.table[b->pt.nb-1].x, b->pt.table[b->pt.nb-1].y, b->pt.table[b->pt.nb-1].z);

		glEnd();
	}

	if(b->affiche)
	{
		glBegin(GL_LINE_STRIP) ;

		glColor3f(1.0, 1.0, 1.0);

		for(j = 0; j < b->pt.nb ; ++j)
			glVertex3f(b->pt.table[j].x, b->pt.table[j].y, b->pt.table[j].z);
		glEnd();
	}

	
}

CLASSE(Bezier, bezier,      
	CHAMP(nbPointAffiche, LABEL("Nombre de points à afficher: ") L_entier Affiche Edite Sauve DEFAUT("10"))
	CHAMP(affiche,LABEL("Afficher les points de controle") L_booleen Edite DEFAUT("1"))
	CHAMP(pt, LABEL("Points ") L_table_point P_table_quadruplet Obligatoire Extrait)
	
	CHANGEMENT(changement_bezier)
	CHAMP_VIRTUEL(L_affiche_gl(affiche_bezier))

	MENU("TP_Bezier/Bezier")
	EVENEMENT("Ctrl+CB")
	)