1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
public void Render(Form1 form)
{
if (graphic == null)
return;
// Caméra
float _alpha = (float)(alpha* (Math.PI / 180));
float _beta = (float)(beta* (Math.PI / 180));
float xO = (float)(rayonSphere * Math.Cos(beta) * Math.Cos(_alpha));
float yO = (float)(rayonSphere * Math.Cos(beta) * Math.Sin(_alpha));
float zO = (float)(rayonSphere * Math.Sin(_beta));
Matrix view = Matrix.LookAtRH(new Vector3((float)(xCentre + xO), (float)(yCentre + yO), (float)(zCentre + zO)), new Vector3(xCentre, yCentre, zCentre), new Vector3((float)(-Math.Cos(_alpha)), (float)(-Math.Sin(_alpha)), 0.0f));
Matrix world = projection * view;
// Réglage de la vue avec world?
????
// Dessin
graphic.BeginDraw();
graphic.Clear(SharpDX.Color.Black);
graphic.EndDraw();
swapChain.Present(0, PresentFlags.None);
} |