Nov 14, 2011 at 8:53 AM
Edited Nov 14, 2011 at 8:56 AM
hi ohan I am trying to make my game are adjustable.
i ask the user to put the groundmarker then I keep it's worldtransformation.
then user removes the groundmarker, and using the toolbarmarker sets the game area.
the problem is, it is not always level.
also the box moves up or down instead of size increasing in y axis. the x axis works fine. though.so the problem is that when i move the toolbar marker further away from camera the red box moves up instead of sticking on the ground.
here is a video
here is how i do it
if (MaxX < setupMarkerNode.WorldTransformation.M41) //setupMarkerNode is the small toolbarMarker
MaxX = (int)setupMarkerNode.WorldTransformation.M41;
if (MinX > setupMarkerNode.WorldTransformation.M41)
MinX = (int)setupMarkerNode.WorldTransformation.M41;
if (MaxY < setupMarkerNode.WorldTransformation.M42)
MaxY = (int)setupMarkerNode.WorldTransformation.M42;
if (MinY > setupMarkerNode.WorldTransformation.M42)
MinY = (int)setupMarkerNode.WorldTransformation.M42;
Matrix mat = groundNodeTransformation; //groundNodeTransformation is groundMarkerNode.Worldtransformation which is saved when space is pressed
mat.M41 = (MaxX + MinX)/2;
mat.M42 = (MaxY + MinY)/2;
boxNode.Model = new Box((MaxX - MinX), (MaxY - MinY), 2); //boxNode is the red box
boxTransNode.WorldTransformation = mat;
do you have any suggestions to do this better. i am basically trying to do what these guys are doing btw 0:08 - 0:30 (without the height, for now)
thanks for your help.