123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|73|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> 3D calculation

Tue, 28 Jul 2009, 14:10
Afr0
Is there a specific calculation for making a quad of a given size (I.E Height = 50, Width = 50) of vertices?

I'm trying desperately to put together a GUI in DirectX using textured quads, and I'm not being very successful.
I could use XNA, and it's very tempting, but I kinda want to try to learn how to do things in DirectX.

Here's some of my current code:





Right now I can draw the quad pretty much anywhere in 3D space, but the size seems to vary randomly based on where I draw it.
I need a specific way to determine the size!

Also, what are U,V coordinates and how do I use them to apply a texture to my quad?

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Tue, 28 Jul 2009, 14:16
Phoenix
First off, no to MDX. It is old, buggy and unsupported. This no is even more reinforced when there is SlimDX, which is an excellent and more complete version of DirectX for .NET than MDX ever was.

I'm not sure how those X/Y/Width/Height parameters relate to quads when they're passed to the Window constructor, but I'm guessing that you're after this instead:

Tue, 28 Jul 2009, 15:14
Afr0
Nope, didn't work.
Any other suggestions??
Tue, 28 Jul 2009, 17:32
JL235
If all you want to use this for is to build a hardware accelerated GUI for an application then you might want to take a look at WPF (Windows Presentation Foundation). It's a .NET subsystem for creating GUIs that are rendered with DirectX rather then GDI. i.e. what you are trying to build above.