Results 1 to 27 of 27

Thread: VB: Directx 8 3d cube -[RESOLVED]-

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Resolved VB: Directx 8 3d cube -[RESOLVED]-

    ok i am starting to learn dx8 and 3d. But one thing i don't get is why in the turorial on directx4vb.com it has 6 vertices on one side. so 36 vertices for the cube.

    Cube(0) = CreateLitVertex(-1, 1, DFC, C011, 0, 0, 0)
    Cube(1) = CreateLitVertex(1, 1, DFC, C011, 0, 0, 0)
    Cube(2) = CreateLitVertex(-1, -1, DFC, C011, 0, 0, 0)
    Cube(3) = CreateLitVertex(1, 1, DFC, C011, 0, 0, 0)
    Cube(4) = CreateLitVertex(-1, -1, DFC, C011, 0, 0, 0)
    Cube(5) = CreateLitVertex(1, -1, DFC, C011, 0, 0, 0)

    thats the code and it has a createlitVertex function. but i don't get why it has 6 vertices instead of 4 for one side of the cube. Can sum1 explain this to me.

    if you want to see the whole code goto
    http://216.5.163.53/DirectX4Vb/index.asp
    it has the tutorial that i am using
    i would appreciate it if some1 could explain it to me.
    thnx
    Last edited by Electroman; Dec 8th, 2004 at 07:55 PM. Reason: Added Language to title & Changed to Resolved Icon

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    It is because that each quad is done by making 2 triangles. Each triangle has 3 vertices. So then you get 3*2 and that is 6 vertices for each quad.

    There is other ways to do it too tho, but that is probably the way they have done it in that tutorial.


    ØØ

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Re: directx 8 3d cube

    ok thnx and another thing can ne1 recomend some good books for directx 8??
    i have found this one "Special Effects Game Programming with DirectX w/CD". it looks great but i'm not sure if it is for vb. can ne1 recomend some good ones if this isn't really for vb
    thnx

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    I am affraid that one is not for VB sorry. It is C++, and it is not even a starters book (at least I don't like to call it a starter book).


    I have only read one book (or actualy just half of it) on DX8 for VB. This one:

    http://www.amazon.com/exec/obidos/tg...e&s=books&st=*

    It is not great...but ok. But there isn't many books written for VB and DX. I know there is at least one other. This one:

    http://www.amazon.com/exec/obidos/tg...glance&s=books

    But I have no idea if it is any good. There is also a couple of books on VB.NET if that is what you like. But most of the DX books out there is for C++. Sorry.


    ØØ

  5. #5
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: directx 8 3d cube

    On the contrary, there is an excellent one out there that I own.

    Microsoft Visual Basic Game Programing with DirectX by Andre Lamothe.



    My only complain about that book is how he uses the camera. You aren't supposed to use the D3DXMatrixLookAtLH function to move the camera around unless you are using Quaternions. But you can use it for a starting position for the camera. You are actually suppose to do matrix math to the viewing matrix (camera matrix), such as D3DXMatrixRotateX, D3DXMatrixRotateY, D3DXMatrixRotateZ, and D3DXMatrixTranslate. Only you rotate first before translating. But other than that, it's an awesome book.
    Last edited by Jacob Roman; Dec 5th, 2004 at 08:50 PM.

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    Quote Originally Posted by Jacob Roman
    On the contrary, there is an excellent one out there that I own.

    Microsoft Visual Basic Game Programing with DirectX by Andre Lamothe.



    My only complain about that book is how he uses the camera. You aren't supposed to use the D3DXMatrixLookAtLH function to move the camera around unless you are using Quaternions. But you can use it for a starting position for the camera.
    Do you mean the book WRITTEN by Jonathan S. Harbour? Andre LaMothe is the Series Editor of "the premier press - Game development series"

    So if we are talking about the same book, then I would say that that book is more aimed on DX7 and DDraw then it is on DX8 D3D.


    ØØ

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Re: directx 8 3d cube

    has ne1 read the book "Windows Game Programming with Visual Basic and DirectX (With CD-ROM)" . it looks liek a good book and i'm wondering if it would b a good book to buy to learn directx8

  8. #8
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    hehe...funny...did you add that picture and the rest about after the camera thingy afterwards?

  9. #9
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: directx 8 3d cube

    Oh yeah sorry bout the Author mix up. But what he does is teach you DirectX7's DirectDraw first, then he teaches DirectX8's Direct3D. And plus, even in DirectX7, he uses DirectX8 for Input and DirectPlay.

    [Edit] Yep I sure did.

  10. #10
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: directx 8 3d cube

    Quote Originally Posted by NoteMe
    hehe...funny...did you add that picture and the rest about after the camera thingy afterwards?
    Then I said "Yep I sure did"

  11. #11
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    Did you edit it two times? Because I didn't see the picture first. And only half the text is in my quote? If not that is a weird bug, or I just didn't see the picture at first.

    Yeah, it teaches you DX8 too...at least after 600 pages. But anyhow, it is the best book I have read about DX in VB, but still I think it is to little code on D3D and DX8 to call it a DX8 book.

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Re: directx 8 3d cube

    is it worth getting? i just learned how to do simple 2d stuff in dx8 like drawing shapes , texturing them , and transparencies. I want to learn some 3d stuff now. is it worth it?

  13. #13
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: directx 8 3d cube

    I didn't expect a reply right away. But yeah I edited twice. There needs to be more books out there on DirectX8 for VB. And it sucks now that DirectX9 isn't supported in it. Microsoft is slowly killing off VB. I know they came out with VB.NET and all but after working with it, I realized that it is its own language and completely different than VB6. But that's another story.

    Quote Originally Posted by vbuser1338
    is it worth getting? i just learned how to do simple 2d stuff in dx8 like drawing shapes , texturing them , and transparencies. I want to learn some 3d stuff now. is it worth it?

    Yes it's worth it. It helped me learn

  14. #14
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    If you want to do this in VB, there is no other books I would recomend over it. Even if it doesn't spoil you in D3D examples and stuff.

  15. #15
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    Quote Originally Posted by Jacob Roman
    I didn't expect a reply right away. But yeah I edited twice. There needs to be more books out there on DirectX8 for VB. And it sucks now that DirectX9 isn't supported in it. Microsoft is slowly killing off VB. I know they came out with VB.NET and all but after working with it, I realized that it is its own language and completely different than VB6. But that's another story.

    I don't think there will be any more books for VB6 and DX...I am pretty sure these are the last books. The rest will be for VB.NET, C++ and probably more and more books will use C# from now on. Not even sure if there will be so many books on VB.NET. Thats at least my 2cents.


    ØØ


    [Edit] Ohhh sooo you did edit it two times, well you must have done the first editing between my reading and me pressing the quote button...

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Re: directx 8 3d cube

    ya i was going to start c++ because thats what all the tutorials are for and could get faster speeds for games. But I find it kind of compicated to learn. It is a little confussing at some times. Maybe i should find a book on learing c++.

  17. #17
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: directx 8 3d cube

    Just making my posts better. I'm a perfectionists sometimes.

  18. #18
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    Quote Originally Posted by vbuser1338
    ya i was going to start c++ because thats what all the tutorials are for and could get faster speeds for games. But I find it kind of compicated to learn. It is a little confussing at some times. Maybe i should find a book on learing c++.

    At least you should know your way in and out of C++ before you do DX in C++. I often see ugly things when people try to do DX in C++ before they know C++. And they steal code all over the place, and can't understand why it isn't working.

    You should think about how serious you are about this. If you are just doing this because you want to have some fun, or something like that. Then that book and VB is going to get you far enough.

    ØØ

  19. #19

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Re: directx 8 3d cube

    Ne of you program in c++ and kno some books on c++. Beginner books. Like shows you how to do types well that what they're called in vb,using picture boxes and all the basics of c++ programming. Ne1 kno some great books there must be some out there
    thnx

  20. #20
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    Quote Originally Posted by vbuser1338
    Ne of you program in c++ and kno some books on c++. Beginner books. Like shows you how to do types well that what they're called in vb,using picture boxes and all the basics of c++ programming. Ne1 kno some great books there must be some out there
    thnx

    C++ does not have any GUI in it at all......thats the hardest part for a VB programmer to get over. And it takes much time and effort to get anything else then a black console box with some letters out with C++. A good book is "C++ from the beginning - Jan skansholm". We used it at school. It is about 600 pages, and you still don't get anything else then the black console box, with some white letters when you are done with it...

    ØØ

  21. #21
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: directx 8 3d cube

    It is quite possible to get VB to go just as fast as C++. It all depends on how you code it. Both output's from VB and C++ get compiled into assembly form anyways, which then gets converted into a binary EXE file.

    The reason why VB is slow in a lot of things is because:

    1) Some of the built in functions are slow.

    2) People tend to leave out Option Explicit, use Varients, use the wrong data
    types, not worry about ByVal and ByRef, etc etc etc.

    3) People who use DoEvents rather than API's. There are faster methods.

    So like I said, it all depends on how you code it. Also DirectX is based on low level graphic routines anyways, and since both languages can use it, they are just about as fast as each other. It all depends how you code it.

  22. #22

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Re: directx 8 3d cube

    i saw this book on amazon "The Beginner's Guide to C++" it has a 4.5 rating ne1 read it. it looks great?

  23. #23
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    Quote Originally Posted by Jacob Roman
    It is quite possible to get VB to go just as fast as C++. It all depends on how you code it. Both output's from VB and C++ get compiled into assembly form anyways, which then gets converted into a binary EXE file.

    The reason why VB is slow in a lot of things is because:

    1) Some of the built in functions are slow.

    2) People tend to leave out Option Explicit, use Varients, use the wrong data
    types, not worry about ByVal and ByRef, etc etc etc.

    3) People who use DoEvents rather than API's. There are faster methods.

    So like I said, it all depends on how you code it. Also DirectX is based on low level graphic routines anyways, and since both languages can use it, they are just about as fast as each other. It all depends how you code it.

    VB lacks a lot of feautures that makes C++ speedier then VB. Real pointers, and you can't use pointer arethmetrics. Real classes, and multible inheritence. Polymorfism. And a lot of other things like automaticaly initialization of variables. And C++ is all ready a lower level languae, so it is easier to optimize it when it gets compiled to native code then a higher level language like VB.

  24. #24
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    Quote Originally Posted by vbuser1338
    i saw this book on amazon "The Beginner's Guide to C++" it has a 4.5 rating ne1 read it. it looks great?

    If it is the same as this one:
    http://www.amazon.com/exec/obidos/se...821676-4638208

    you should probably steer away. It is written in 1994. A few changes might have happend since back then...

  25. #25

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    31

    Re: directx 8 3d cube

    what do u mean by c++ is a lower level language then vb?

  26. #26
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: directx 8 3d cube

    All languages is "defined" in a kind of level, from low to high. Like C is a low level language. And C++ is often refered to as mid level or high level. And Java is a high level language, and VB and Delhpi is often refered to as RAD (Rapid application development) languages. ASM is nearly at the bottom, and is the closest you get to machine code without actualy using it. The lover the language is, the faster it is possible to make it run. But if you are REALY good in C++, and not so good in ASM, you will often get faster apps in C++ then ASM, because the colmiler does a hell of a great job for you.

  27. #27
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: directx 8 3d cube

    I agree. C++ is a mid level language. Plus VB is lacking a lot of features that C++ has. VB.NET was created to be more Object Oriented and contain a hell of a lot of C++ features that VB was lacking. VB.NET 2005 will have operator overloading. I still have complaints on VB.NET though, such as not being able to call functions on demand (unless I use the Imports statement and know where the functions located) and forced to dig into their huge classes for functions. I'm forced to type things like

    System.Forms.Form.CreateGraphics.GetHdc.ToInt32()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width