Jump to content
  • Advertisement

Archived

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

cryo75

Drawing a grid

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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, you`ll create a box which shall represent your current position in the grid, where you`ll move quad by quad - and when you`re 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 you`re done.

VladR
Avenger game

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
yes if you want wireframe then just apply the wireframe renderstate ^^ (search on the SDK for the exact name)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!