Skip to main content
GameDev.net gamedev.net
🔒 Locked

draw shape help

Started by whoop1 Dec 12, 2005 at 4:39 AM 1 replies 400+ views
Original Post
whoop1
whoop1
hi, dont know anything about direct x really, have the following code that draws a rect. D3DRECT Rect1 = { GridTopLeftX+8 + row*20, GridTopLeftY+2 + column*20,GridTopLeftX+5 + row*20, GridTopLeftY+14 + column*20}; Rectangle32Fast( &Rect1, D3DCOLOR_XRGB( 0, 0, 0 ), g_pDevice ); I want to be able to draw a different shape, i.e. a cylindrical shape or a square with a rounded top, do any of you guys think you know how to do this? many thanks steve
Armadon
Armadon
Generally when getting to complex shapes it's sometimes beneficial to create meshes of these shapes. If you are in the situation that you need to create these in runtime you could follow some algorithms to help you in the process.

Always try and break the problem into smaller pieces like take for example a cylinder. You have a top and a bottom made out of circles and then if you fold open your cylinder you will have a rectangle.

I would suggest that you give us a better explanation of what you want to do and maybe we can help you get on track.

I hope this helps.
Take care.
whoop1
whoop1
im trying to draw a sprite in a game using c++ and direct x, i want this sprite to be a square shape with a semi circle at the top to make it rounded at the top

like the stop icon i have used with a flat bottom

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.