Bonjour,

Je souhaite utiliser l'instance "world" de type Matrix pour régler la vue globale. J'utilise sharpdx.

J'ai trouver des réponses en directX9, mais le code à changé avec direct11.

Voici le Rendu:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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);
        }
J'ai déclarer mon device ainsi:

public SharpDX.Direct3D11.Device device = null;

et "projection" est une instance de type Matrix définie en amont dans mon code.

Comment utiliser la matrice world?

Merci de votre aide.