dcsimg
Page 2 of 2 FirstFirst 12
Results 41 to 58 of 58

Thread: [VB6] Direct3D9.

  1. #41
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,226

    Re: [VB6] Direct3D9.

    Quote Originally Posted by xman2000 View Post
    Hi, TheTrick

    is awesome this 3D9 libary, you like make this entire in VB6 ? why?
    Hi xman2000,

    I've got no idea what motivates The Trick, as I've got little idea what motivates myself. However, I'm sure glad that The Trick was willing to share this work. I've used it in several of my own VB6 projects. Here's a C3D mocap reader I've posted on the CodeBank that uses it. I've also used it in several other contexts.

    Take Care,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #42
    Lively Member
    Join Date
    Jun 2016
    Posts
    89

    Re: [VB6] Direct3D9.

    Quote Originally Posted by Elroy View Post
    Hi xman2000,

    I've got no idea what motivates The Trick, as I've got little idea what motivates myself. However, I'm sure glad that The Trick was willing to share this work. I've used it in several of my own VB6 projects. Here's a C3D mocap reader I've posted on the CodeBank that uses it. I've also used it in several other contexts.

    Take Care,
    Elroy
    Hi Elroy,
    this 3D9 libray is a greate work, greate project, and not problem if closed source-code, only i need some time use pure vb6 and i like to find in the web a pure vb6 library like this 3D9.

    My intention not is find the library only by algorithms but to pradronize the code, and se Library is big i use like external compiled file, but if the codes i need is small i use only few codes of library to my project, or rebuild the library into small libraries but with same pradronized code, to avoid bugs, to make more easy understand.

    only is a question to know the plans of the autor and possible difficulties to implement this idea.


    cheers.
    Last edited by xman2000; Dec 23rd, 2018 at 10:41 AM.

  3. #43
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,226

    Re: [VB6] Direct3D9.

    Quote Originally Posted by xman2000 View Post
    this 3D9 libray is a greate work, greate project, and not problem if closed source-code, only i need some time use pure vb6 and i like to find in the web a pure vb6 library like this 3D9.
    Hi Xman,

    Everything about The Trick's work is open-source. I'm not sure what you mean by closed-source?!

    He provided many linear algebra procedures (in VB6 open-source source-code). But the main thing he provides is the DX9VB.tlb TypeLib, which allows VB6 to interface with the DirectX3D library built into Windows. And this DX9VB.tlb is easily open-source as well. Here, I've attached the IDL file for your perusal (see attached ZIP).

    Now, you say "pure VB6". This is about as pure VB6 as it gets. Do you want to do all the DirectX3D graphics functions in VB6 code? If so, that's sort of insane because the DirectX technology interfaces directly with the GPU (graphics processing unit) of your hardware to do its work. Sure, you could write your own procedures with the graphics statements of a PictureBox (or a Form), but they'd be MUCH slower than anything using DirectX. Without DirectX (or some other similar technology, such as the stuff that uses OpenGL), you're not interfacing directly with the GPU. That's the whole reason for DirectX.

    Now, if you want the TypeLib out of the picture (and there's really no reason for that), you could drop back to DirectX8, which is directly COM compatible. Also DirectX8 uses StdCall, which allows for API declarations directly in the VB6 source code, and no need for a TypeLib. But again, what's wrong with a TypeLib?

    The DirectX9 just comes with all recent versions of Windows, which is very convenient. However, to use DirectX8, you'll have to find a copy of the dx8vb.dll, and distribute it with your application.

    Good Luck,
    Elroy
    Attached Files Attached Files
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  4. #44
    Lively Member
    Join Date
    Jun 2016
    Posts
    89

    Re: [VB6] Direct3D9.

    Hi, Elroy,

    yes, i like "Do you want to do all the DirectX3D graphics functions in VB6 code? If so, that's sort of insane"

    not problem if is more slow, only if works very well.

    "Now, if you want the TypeLib out of the picture"
    i not understand "out of the picture" but i like the TypeLib in pure vb6 inside the project like a module .bas, or class or .frm but i need not use files.

    in some times i use external files, .dll, .ocx, but other times i like use only vb6 code and others with apis.

    i understand you speak this Libarry is to DirectX interaction, i I had imagined that something like this already existed, and that this library was a little (little and simple) substitute for Directx and people can add more features.

    "you're not interfacing directly with the GPU"
    yes, we can make a 3D Library replacement of Directx more simple with not GPU and other version of the 3D library with GPU.

    What would we need to do to create a GPU version?
    there would be a need to create compatibility for the drivers of each VGA GPU device of each company?
    eu can stop this subject not to flood this thread.

    not problem if is more slow, only if works very well and not uses external files or external ressources, the most compatible and universal is better for some uses.

    like this idea: have a 3D libray in pure VB6 i can put all code inside the vb project an re-use all functions and rebuild the big library into small libraries to especific purposes and can padronize the codes i use in image processing, and can add more features, more algorithms like scientific and image vision, medical, etc.

    edit:it is not always necessary that the performance be very fast as for games at 60fps, it can be slow if it is only to visualize an object or a scenario observing the details, but perhaps to edit objects and see the changes in a reasonable speed a non- GPU library I do not know if it will.


    edit2: but if we can but use the GPU but with everything written in VB6 with total replacement of Directx or OpenGL would be very good, even if it is a little slower than them.

    This 3D9 library by TheTrick is greate and is specific to DirectX, greate!
    I was not sure if it was this or a replacement. Now i know.
    Last edited by xman2000; Dec 23rd, 2018 at 12:29 PM.

  5. #45
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Re: [VB6] Direct3D9.

    How about this? im using this source code but I cant load pictures from memory. Thanks.

  6. #46

  7. #47
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Re: [VB6] Direct3D9.

    Hi The trick! Thanks for replying.

    Im trying to load a PNG file in memory directly into DX9, I used the D3Dx.CreateTextureFromFileInMemoryEx but I cannot find it in your typelib. Thanks.

  8. #48

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2015
    Posts
    1,584

    Re: [VB6] Direct3D9.

    Quote Originally Posted by Barrin View Post
    Hi The trick! Thanks for replying.

    Im trying to load a PNG file in memory directly into DX9, I used the D3Dx.CreateTextureFromFileInMemoryEx but I cannot find it in your typelib. Thanks.
    There is no this function in the type library. You could load a picture using GDI+ and using the bits of the picture to initialize texture IDirect3DTexture9.LockRect (see the prjCubeDemo).

  9. #49
    New Member
    Join Date
    Oct 2019
    Posts
    3

    Re: [VB6] Direct3D9.

    Hi all,

    I need your help

    My problem: two textures; one for background (image from hd), the other one with a lot of text (with vertex), black background, and text color random.

    I need to make transparent only the black background, not alpha the text (must be completly opaque)Name:  Schermata del 2019-10-17 10-25-13.jpg
Views: 191
Size:  33.9 KB

    This is my code:

    ' // Apply texture Background
    d3dev.SetTexture 0, texture
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2

    ' // Remove texture
    d3dev.SetTexture 0, Nothing
    d3dev.SetTexture 0, textureText

    d3dev.SetRenderState D3DRS_ALPHABLENDENABLE, 1
    d3dev.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR
    d3dev.SetRenderState D3DRS_DESTBLEND, D3DBLEND_DESTCOLOR
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD


    ' // Draw background
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 6, 2
    d3dev.SetTexture 0, Nothing
    d3dev.EndScene

    d3dev.Present ByVal 0, ByVal 0, 0, ByVal 0


    Thanx in advance.

    Ciao.
    L.

  10. #50
    New Member
    Join Date
    Oct 2019
    Posts
    3

    Re: [VB6] Direct3D9.

    Hi all,

    I need your help

    My problem: two textures; one for background (image from hd), the other one with a lot of text (with vertex), black background, and text color random.

    I need to make transparent only the black background, not alpha the text (must be completly opaque)Name:  Schermata del 2019-10-17 10-25-13.jpg
Views: 191
Size:  33.9 KB

    This is my code:

    ' // Apply texture Background
    d3dev.SetTexture 0, texture
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2

    ' // Remove texture
    d3dev.SetTexture 0, Nothing
    d3dev.SetTexture 0, textureText

    d3dev.SetRenderState D3DRS_ALPHABLENDENABLE, 1
    d3dev.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR
    d3dev.SetRenderState D3DRS_DESTBLEND, D3DBLEND_DESTCOLOR
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD
    d3dev.SetRenderState D3DRS_BLENDOP, D3DBLENDOP_ADD


    ' // Draw background
    d3dev.DrawPrimitive D3DPT_TRIANGLELIST, 6, 2
    d3dev.SetTexture 0, Nothing
    d3dev.EndScene

    d3dev.Present ByVal 0, ByVal 0, 0, ByVal 0


    Thanx in advance.

    Ciao.
    L.

  11. #51

  12. #52
    New Member
    Join Date
    Oct 2019
    Posts
    3

    Re: [VB6] Direct3D9.

    Quote Originally Posted by The trick View Post
    Use additive blending (see Fire example demo).
    Hi Trick, first of all thank you (sorry for delay).

    I saw the fire example, but maybe isn't what i'm looking for. My problem is that the second texture (the one with the text only) must be opaque (with black background completly transparent):

    - texture 0: a random image from file
    - texture 1: opaque text (background is black)

    Is possibile?

    PS: As you can see, I'm not an expert of DirectX

    Thank you again.

    Ciao.
    L.

  13. #53

  14. #54
    Hyperactive Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    504

    Re: [VB6] Direct3D9.

    hello this seems to me the best starting point to create a 3d graphic engine for "games".
    What I noticed in the examples is that necessary code in my opinion is a little too low level.
    I'd like to have higher-level classes / functions such as in TrueVision3D.
    Do you think it would be a good idea to build these higher level classes? (in a sense simplified and more intuitive to use)
    anyone interested?
    These classes could be for example:
    • SCENE
    • CAMERA
    • MATERIAL
    • OBJECT
    • MESH
    • TEXTURE
    • LIGHT
    • GROUND
    • SKY
    • HELPER-Math such as VECTOR MATRIX QUATERNION
    • TEXT, "SPRITES", 2D shapes, .... MORE


    What do you think? Is it an absurd idea?
    What difficulties would be encountered?
    What would be the pros and cons?

  15. #55
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,226

    Re: [VB6] Direct3D9.

    Hi Reexre,

    In the project on which I'm currently working, I've got clsDxScene, clsDxMesh, & clsDxCamera. I haven't messed with texturing, and I typically just deal with lighting and ground in the clsDxScene class. I also haven't done anything with the 2D stuff ... well, it's been a while, and it was back when I was still using DX8.

    I'm not sure I'd know the difference between Mesh and Object, nor the difference between Texture and Material.

    Also, The Trick's work was/is always my starting place with DX9, but I've reworked all his math procedures into functions. They're just more intuitive to me that way, so I'm not starting from exactly the same place as everyone else.

    But, I certainly think it's a good idea, possibly a VB6 DLL with its own set of classes and calls.

    Take Care,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  16. #56
    Hyperactive Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    504

    Re: [VB6] Direct3D9.

    Quote Originally Posted by Elroy View Post
    In the project on which I'm currently working, I've got clsDxScene, clsDxMesh, & clsDxCamera. I haven't messed with texturing, and I typically just deal with lighting and ground in the clsDxScene class. I also haven't done anything with the 2D stuff ... well, it's been a while, and it was back when I was still using DX8.
    Wow very interesting! Do you plan on sharing this code at some point?

    I'm not sure I'd know the difference between Mesh and Object, nor the difference between Texture and Material.
    About Object I think I was wrong... Yes it should be the same.
    About Textutre and Material I would differentiate them like this:
    Material is what concerns color and the relationship with light such as reflection etc.
    Texture is a kind of image applied to a surface.
    but, yes in fact they can also be considered as a single aspect. (of a surface / mesh)

    Also, The Trick's work was/is always my starting place with DX9, but I've reworked all his math procedures into functions. They're just more intuitive to me that way, so I'm not starting from exactly the same place as everyone else.
    Agree and understand

    But, I certainly think it's a good idea, possibly a VB6 DLL with its own set of classes and calls.
    Yes, I too had thought of a DLL.

    Well, then if you want to share the code it would be fantastic, and maybe somehow me and others could contribute to it.

    EDIT:
    Here's what I thought about OBJECT.
    By OBJECT I meant a hierarchical set of meshes. (Parent / child)
    Which could have characteristics related to the other such as pivot point and rotation.

  17. #57
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,226

    Re: [VB6] Direct3D9.

    Quote Originally Posted by reexre View Post
    Here's what I thought about OBJECT.
    By OBJECT I meant a hierarchical set of meshes. (Parent / child)
    Which could have characteristics related to the other such as pivot point and rotation.
    Yeah, after I posted, I had a similar though. An "Object" might be a way to group individual mesh pieces. And then, they could possibly be moved and rotated as a unit.

    And yeah, I see the distinction between Texture and Material.

    I'm still deciding about when/whether I'm going to share the code to this latest project. However, here is another project that has pretty much all of the same features.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  18. #58
    Hyperactive Member
    Join Date
    Sep 2010
    Location
    Italy
    Posts
    504

    Re: [VB6] Direct3D9.

    Quote Originally Posted by Elroy View Post
    ..... However, here is another project that has pretty much all of the same features.
    Wow huge work!
    So I begin creating the engine using it.
    I opened a new thread about this

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width