Method of plotting 2D grid

Hi. I have a question. How would I plot 2D grid? It's got to be infinate but without any performance loss. Will this work?

To show you wnat I mean, download a trial version of3D GameStudio and open GameStdudio in 3D GameStdudio, located in the Program group.

And one more question. Since I'm going to be developing an authoring suite along with an engine, in an application (world editor) with 4 windows, would it be possible to have 4 D3D child windows with just one device? Or do I have to create a device per window? Each of the child windows will have

  • Top
  • Right
  • Back
  • 3D

The four windows will have to be in sync. Here's the table showing if I work with certain parts of a window:

Working with...

Will hae an effect in...

TopRight, Back, 3D
RightTop, Back, 3D
BackTop, Right, 3D
3DTop, Right, Back

It's as simple as that. When you create a cube in 3D GameStudio (Object -> Add Cube -> Large), each of the four child windows will have a cube.

That's all I have. Don't forget about my question about the grid.

[1659 byte] By [GraysonPeddie] at [2008-1-12]
# 1
Grayson Peddie wrote:

It's got to be infinate but without any performance loss. Will this work?

Not to be too picky, but an infinite grid would be impossible due to, well, it being infinite Big Smile
But, to answer your question, if you create the geometry for a single screen's worth of grid you can perform various operations such that it might appear to be infinite to the end user. Either through matrix transforms (scale/rotate/repeat etc..) or directly manipulating the geometry (locking the buffer and changing colours/offsets etc..).

Grayson Peddie wrote:

would it be possible to have 4 D3D child windows with just one device? Or do I have to create a device per window?

Yes, what you want is possible - I'd recommend you look into swap chains. You'll need to target different hWnd's (or whatever the Managed equivalent is).

If you were to go for the trivial implementation and create 4 devices you'd have to duplicate everything 4 times as one device cannot see/use resources owned by another device. Obviously this causes resource problems as you're effectively quadrupling the amount of data you're storing.

hth
Jack
JackHoxley at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2
Try using viewports instead of seperate swap chains. Swap chains are good if you want seperate windows, but If you're looking for multiple views on one client then viewports are much more efficient.

GrkEngineer

GrkEngineer at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...