Hi again.
Making progress with my editor and I am now able to draw cubes into my scenes.
Next step would be a mouse detection for them so I tested out IntersectCubeVolume. I know that the framework has additional helper classes for handling models and mouse detection and stuff but for now I would like to do it manually.
So I wondered how I enter the size of the cube volume first to check. Looked up again how 4x4 matrixes are build up (im still not that used to them
) and tested:
aWorld.Data[0,0] := 100;
aWorld.Data[1,1] := 50;
aWorld.Data[2,2] := 50;
Mouseray.IntersectCubeVolume(aWorld,aDistance);
And that worked so far and correctly detected a cube volume with the size of 100x50x50 around the center of the worldspace.
So I thought cool, thats seems to be it.
But when I now try to move that cube around by for example:
aWorld.Data[0,0] := 100;
aWorld.Data[1,1] := 50;
aWorld.Data[2,2] := 50;
aWorld := aWorld * TMatrix4f.Translate (Vector3f(200,0,0));
Mouseray.IntersectCubeVolume(aWorld,aDistance);
It is still only detected around the center of the worldspace. The translation seems to be ignored. DO I have to specify more stuff in the matrix first? Sorry, if this is something I should know by now. Matrixes are still confusing me ^^
Making progress with my editor and I am now able to draw cubes into my scenes.
Next step would be a mouse detection for them so I tested out IntersectCubeVolume. I know that the framework has additional helper classes for handling models and mouse detection and stuff but for now I would like to do it manually.
So I wondered how I enter the size of the cube volume first to check. Looked up again how 4x4 matrixes are build up (im still not that used to them
) and tested:aWorld.Data[0,0] := 100;
aWorld.Data[1,1] := 50;
aWorld.Data[2,2] := 50;
Mouseray.IntersectCubeVolume(aWorld,aDistance);
And that worked so far and correctly detected a cube volume with the size of 100x50x50 around the center of the worldspace.
So I thought cool, thats seems to be it.
But when I now try to move that cube around by for example:
aWorld.Data[0,0] := 100;
aWorld.Data[1,1] := 50;
aWorld.Data[2,2] := 50;
aWorld := aWorld * TMatrix4f.Translate (Vector3f(200,0,0));
Mouseray.IntersectCubeVolume(aWorld,aDistance);
It is still only detected around the center of the worldspace. The translation seems to be ignored. DO I have to specify more stuff in the matrix first? Sorry, if this is something I should know by now. Matrixes are still confusing me ^^

Comment