#### Archived

This topic is now archived and is closed to further replies.

# Drawing a grid

This topic is 5384 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Wow... it took me a whole weekend to set up a simple window and clear it... well... I''m using the d3dapp.cpp/etc to do it but hey... I''m still learning!! My next step in learning is that I want to display a grid at an angle which goes away from the screen. Are there any tutorials or links to point me in the right direction?? Ivan

##### Share on other sites
A grid? Do you mean like a plane on the screen, like perspective view in 3dsmax? If so, then it''s just a bunch of triangles.. or, rather, a bunch of lines. Because if they were triangles you wouldn''t be able to see the lines. For more complex things, then it''s just google for you

##### Share on other sites
Oddly enough, D3D doesn''t support line widths while Open GL does. As a result, to get a thicker line you''ll need to render the line again with a slight offset.

##### Share on other sites
yeah something like a perspective view. but it has to be for a terrain engine that I want to build, so that I can switch between the terrain, the wireframe or the wireframe imposed on the terrain. the terrain will be a tiled terrain but in 3d. the thing is that I don''t know really from where to start...

##### Share on other sites
quote:
Original post by Hawkeye3
Oddly enough, D3D doesn''t support line widths while Open GL does. As a result, to get a thicker line you''ll need to render the line again with a slight offset.

Dx9 does have support for line widths, and textured lines. Not sure exactly was the commands are, but i think its a set of D3DX util commands. Have a look in the SDK doc and that should clear it up for you

##### Share on other sites
Best thing you can do is to create the Grid by lines. Bottom-Left corner shall be at point (0,0,0) and it shall lie on XZ plane - i.e. all points on grid shall have y=0.0f
Then, youll create a box which shall represent your current position in the grid, where youll move quad by quad - and when youre at position you want to be, just place there any imported object (from some 3d modelling SW) and voila, you have a simple editor ! Then just add Save/Load and youre done.

Avenger game

##### Share on other sites
That won''t work because at the end I want it to be a wireframe model of the landscape and not a real ''grid''...

Do quads have something to do with it??

##### Share on other sites
Do a search in the docs for ID3DXLine Interface. Thats what I was thinking about in my previous post. That should do what you want to achive (i think)!

##### Share on other sites
make everything quads then render in wireframe mode, lol

##### Share on other sites
yes if you want wireframe then just apply the wireframe renderstate ^^ (search on the SDK for the exact name)

• 16
• 11
• 11
• 9
• 49
• ### Forum Statistics

• Total Topics
631394
• Total Posts
2999749
×