Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Direct3D
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Vankwysha
Squire

Australia
43 Posts

Posted - Jul 28 2005 :  04:49:51 AM  Show Profile  Click to see Vankwysha's MSN Messenger address  Reply with Quote
I've almost finished writing my 2D graphics DLL and it's working to about 95% effectiveness so far. I'm using Direct3D.Texture and Direct3D.Sprite objects to render my 2D graphics, and it's working like a charm.

However.

There's still a couple of things that I want to do, and I haven't been able to find any simple ways to do them.

1) Rotation. Is there any way for me to rotate my Direct3D.Sprite without having to use all that complex meshes and matrices stuff (which I don't understand)? If not, I would appreciate some explanation of how that works.

2) Drawing simple stuff. I want to be able to draw simple 2D graphics such as lines, triangles, rectangles etc. I think i read something about triangle fans or strips or something, and I would also like to know if there's a simple way to do this, or if not an explanation.

Many thanks.

Lachlan87
Moderator

USA
160 Posts

Posted - Jul 28 2005 :  09:26:48 AM  Show Profile  Reply with Quote
When you draw your sprite, there are 7 parameters that you pass to sprite.Draw: The texture, the size, the scaling value, the centerpoint for rotation, the rotation value, the translation, and the color.

To rotate your sprite, simply pass somthing other than 0.



Go to Top of Page

Vampire
Squire

15 Posts

Posted - Jul 29 2005 :  12:13:53 AM  Show Profile  Visit Vampire's Homepage  Reply with Quote
For drawing simple geometrics and texts: Lock the backbuffer, do the drawings just like in GUI and then unlock the surface. Don't forget the last step, Windows will crash.
Go to Top of Page

Vankwysha
Squire

Australia
43 Posts

Posted - Jul 29 2005 :  02:17:01 AM  Show Profile  Click to see Vankwysha's MSN Messenger address  Reply with Quote
quote:
Originally posted by Vampire

For drawing simple geometrics and texts: Lock the backbuffer, do the drawings just like in GUI and then unlock the surface. Don't forget the last step, Windows will crash.



That sounds more like DirectDraw, I haven't been able to see any DrawLine or DrawRectangle methods within Direct3D.
Go to Top of Page

Vankwysha
Squire

Australia
43 Posts

Posted - Jul 30 2005 :  02:53:45 AM  Show Profile  Click to see Vankwysha's MSN Messenger address  Reply with Quote
I've been looking through the methods for the DirectX.Device class and I found a couple relating to drawing primitives. These take parameters which let you draw Line Lists, Line Strips, Triangle Strips etc. but I have absolutely no idea what the rest of the parameters do, lots of weird stuff relating to vertex buffers and the like. Could someone please explain this to me, preferably with code or an example?

Also, when I specify anything other than 0,0 for the rotational centre of a sprite it doesn't even get drawn, I think it must be off-screen, could someone also please explain that?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.09 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.