I have a table of data, which includes coordinates and other data.
Using the coordinates I want to place a box of a predetermined size (16 pixels x 16 pixels) to a computed location on the screen. This is the easy part.
later I want to capture mouseovers, translate from the mouse x,y back to my coordinate system, and pull out data for that record.
The problem is that this data map is too large to fit on the screen (we are talking about 100,000 - 500,000 records in the data set.) I need a way to let the user move horizontal and vertical, but I want the data map to always face the camera.
I looked at some of the examples and I am stumped as to how to use the BillboardSceneNode and a camera to make it work.
here's what I have for code to set up the camera so far.
Code: Select all
node = device.SceneManager.AddBillboardSceneNode(null, new Dimension2Df(800f, 600f), new Vector3D(0, 0, 0), 0);
ICameraSceneNode camera = device.SceneManager.AddCameraSceneNodeFPS(null, 100, 100, 0);
camera.Position = new Vector3D(0, 0, 0);
Code: Select all
public bool OnEvent(Event e)
{
if (node != null && e.Type == EventType.KeyInput &&
!e.KeyPressedDown)
{
switch (e.Key)
{
case KeyCode.KEY_ESCAPE:
device.CloseDevice();
break;
case KeyCode.KEY_KEY_W:
case KeyCode.KEY_KEY_S:
{
Vector3D v = node.Position;
v.Y += e.Key == KeyCode.KEY_KEY_W ? 2.0f : -2.0f;
node.Position = v;
}
return true;
}
}
return false;
}
Code: Select all
ICameraSceneNode camera = device.SceneManager.AddCameraSceneNode(null, new Vector3D(0, 0, 0), new Vector3D(0, 0, 0), 1);
Code: Select all
int rowId = maximumRange - y;
int columnId = z;
Position2D startPosition = new Position2D((columnId * padding) + (columnId * size) + horizontalOffset, (rowId * padding) + (rowId * size) + verticalOffset);
Position2D endPosition = new Position2D((columnId * padding) + (columnId * size) + size + horizontalOffset, (rowId * padding) + (rowId * size) + size + verticalOffset);
Rect plotBox = new Rect(startPosition, endPosition);
driver.Draw2DRectangle(brushColor, plotBox);