Simple renderer in .net with SharpGL (openGL)

Re: Simple renderer in .net with direct3d
I dug up some very old LD4DModeler code, which used DirectX

In it I do correction during the type 1 line loading.

//x y z
  matrix.m[3, 0]:=getvalue(line);
  matrix.m[3, 1]:=getvalue(line);
  matrix.m[3, 2]:=getvalue(line);
  matrix.m[3, 3]:=1;

  //a b c
  matrix.m[0, 0]:=getvalue(line);
  matrix.m[1, 0]:=getvalue(line);
  matrix.m[2, 0]:=getvalue(line);

  //d e f
  matrix.m[0, 1]:=getvalue(line);
  matrix.m[1, 1]:=getvalue(line);
  matrix.m[2, 1]:=getvalue(line);

  //g h i
  matrix.m[0, 2]:=getvalue(line);
  matrix.m[1, 2]:=getvalue(line);
  matrix.m[2, 2]:=getvalue(line);

  matrix.m[0, 3]:=0;
  matrix.m[1, 3]:=0;
  matrix.m[2, 3]:=0;        

  //rechthandig matrix -> linkshandige matrix
  //(T^-1)ST      waar s bron is en T rh2lhflip is

  D3DXMatrixInverse(mat, @dummy, rh2lhflip);
  D3DXMatrixMultiply(mat, mat, matrix);
  D3DXMatrixMultiply(matrix, mat, rh2lhflip);

rh2lhflip is inited elsewhere as D3DXMatrixScaling(rh2lhflip, 1, -1, 1);

Do note this is very (11 years!) old code, and I wasn't exactly an expert myself at that time Smile

edit: above code is less then correct and unnecessary overcomplicated. It's better to convert to lefthand/neg y axis at the model level.
« Next Oldest | Next Newest »

Messages In This Thread
Re: Simple renderer in .net with direct3d - by Roland Melkert - 2013-11-23, 19:22

Forum Jump:

Users browsing this thread: 1 Guest(s)