dcsimg
Page 1 of 2 12 LastLast
Results 1 to 40 of 53

Thread: [VB6] Direct3D9.

  1. #1

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

    [VB6] Direct3D9.

    Hello everyone.
    In the archive contains a type library "DirectX 9 for Visual Basic 6.0 type library by The trick" (dx9vb.tlb) contains a description of the following interfaces:
    • IDirect3D9;
    • IDirect3DDevice9;
    • IDirect3DSurface9;
    • IDirect3DResource9;
    • IDirect3DSwapChain9;
    • IDirect3DTexture9;
    • IDirect3DBaseTexture9;
    • IDirect3DVolumeTexture9;
    • IDirect3DVolume9;
    • IDirect3DCubeTexture9;
    • IDirect3DVertexBuffer9;
    • IDirect3DIndexBuffer9;
    • IDirect3DStateBlock9;
    • IDirect3DVertexDeclaration9;
    • IDirect3DVertexShader9;
    • IDirect3DPixelShader9;
    • IDirect3DQuery9.

    Also in the library declared many types, constants and enumerations. The work of this library tested poorly, so something may not work. Also in the archive includes several modules written in VB6:
    • D3DX_COLOR.bas - for work with colors;
    • D3DX_MATRICES.bas - for work with matrices;
    • D3DX_QUATERNION.bas - for work with quaternions;
    • D3DX_VECTOR2.bas, D3DX_VECTOR3.bas, D3DX_VECTOR4.bas - for work with vectors;
    • D3DX_MISC.bas - other functions.

    These modules include analogs of the respective functions D3DX. Also in the archive contains several test examples.





    Download.

    08.24.2015. added drawing text example.

    09.17.2015. added 3D form example.

    02.27.2016. Fixed bug in D3DXMatrixTranspose function. Changed type of pointers to Any in methods IDirect3DDevice9::CreateVertexShader, IDirect3DDevice9::CreatePixelShader, IDirect3DDevice9::SetPixelShaderConstantB, IDirect3DDevice9::SetPixelShaderConstantI, IDirect3DDevice9::SetPixelShaderConstantF, IDirect3DDevice9::SetVertexShaderConstantB, IDirect3DDevice9::SetVertexShaderConstantI, IDirect3DDevice9::SetVertexShaderConstantF

    05.06.2018. added simple scene example (camera, procedural generation, mouse picking, basic transformations); "laser lines" example, rendering in different thread example. Fixed bug in functions: D3DXMatrixTranspose, D3DXMatrixRotationQuaternion, D3DXVec2Length;
    Changed function prototype for D3DXPlaneIntersectLine, error raising has been changed to return value;
    Changed behavior of function D3DXQuaternionToAxisAngle, now it accepts non-normalized quaternions;

  2. #2
    Fanatic Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    948

    Re: [VB6] Direct3D9.

    Have you something to draw text?
    I would like to see any implementation..so maybe I put dx9 in M2000 Environment...some day...(Can we make controls with dx9??)

  3. #3

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

    Re: [VB6] Direct3D9.

    For drawing text you can use standard GDI functions. Usually uses special texture which contain a symbols. When you desire to draw some string you create a quads which represent each symbol with texture coordinates. Of course you can create this table dynamically using DrawText, GetTextExtentPoint32 etc.
    I add example work with text, download again it. In the example i use fixed simplest table using only digit and letter:

    If you want create 3D-text look like this:

    Then you should use GetGlyphOutline function in order to obtain a shape of each symbols and extrude mesh from it.

  4. #4

  5. #5
    Junior Member
    Join Date
    Jun 2015
    Posts
    23

    Re: [VB6] Direct3D9.

    This is some really nice work. I think I will be using some of this! Thanks for the efforts!

  6. #6
    New Member
    Join Date
    Sep 2015
    Posts
    14

    Re: [VB6] Direct3D9.

    I have downloaded the file, but I can not find the file "clsTrickSubclass2.cls"
    so, where can I find these files?
    Name:  not found.jpg
Views: 2148
Size:  28.7 KB

  7. #7

  8. #8
    New Member
    Join Date
    Sep 2015
    Posts
    14

    Re: [VB6] Direct3D9.

    Thanks for your help.

  9. #9
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    557

    Re: [VB6] Direct3D9.

    Thanks for this very interesting post.

    Now just quickly browsing through the bas modules, there is an error (typo most probably) in the module : D3DX_VECTOR2.bas

    This function is not quite right :


    Code:
    Public Function D3DXVec2Length(pV As D3DVECTOR2) As Single
        
        D3DXVec2Length = Sqr(pV.X * pV.X + pV.Y + pV.Y)
        
    End Function

  10. #10

  11. #11

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

    Re: [VB6] Direct3D9.

    New version 1.1.
    Fixed bug in D3DXMatrixTranspose function. Changed type of pointers to Any in methods IDirect3DDevice9::CreateVertexShader, IDirect3DDevice9::CreatePixelShader, IDirect3DDevice9::SetPixelShaderConstantB, IDirect3DDevice9::SetPixelShaderConstantI, IDirect3DDevice9::SetPixelShaderConstantF, IDirect3DDevice9::SetVertexShaderConstantB, IDirect3DDevice9::SetVertexShaderConstantI, IDirect3DDevice9::SetVertexShaderConstantF

  12. #12
    Addicted Member
    Join Date
    Jan 2015
    Posts
    172

    Re: [VB6] Direct3D9.

    Hi Thread Starter
    I have found two open source as you do
    http://roardx9.codeplex.com/
    http://www.vbgood.com/thread-80529-1-1.html

  13. #13
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: [VB6] Direct3D9.

    I definitely recommend against Roar - as it's adds a wrapper DLL, instead of calling the API directly.

  14. #14

  15. #15
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: [VB6] Direct3D9.

    Quote Originally Posted by The trick View Post
    I tried to do the independent source therefore the most part of this project is the standard modules with the sources of some D3DX functions. You don't need of an additional dependencies after compilation. I also didn't use any D3DX additional library.
    The best approach

  16. #16

  17. #17
    Fanatic Member
    Join Date
    Oct 2008
    Posts
    992

    Re: [VB6] Direct3D9.

    Your typelib has no sound based interfaces. How do I use dx9 to output and input audio?

  18. #18

  19. #19
    Fanatic Member
    Join Date
    Oct 2008
    Posts
    992

    Re: [VB6] Direct3D9.

    Or how about create a single complete typelib for DX9, that has sound and graphics related interfaces? It appears your typelib is really all about graphics (maybe that's all you care about, but it's not complete). A good typelib for DX9 would do for DX9 what the official MS DX8 and 7 typelibs did, and that is have interfaces for sound AND interfaces for graphics. I assume that DX9 does have sound-based interfaces.

  20. #20

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

    Re: [VB6] Direct3D9.

    Quote Originally Posted by Ben321 View Post
    Or how about create a single complete typelib for DX9, that has sound and graphics related interfaces? It appears your typelib is really all about graphics (maybe that's all you care about, but it's not complete). A good typelib for DX9 would do for DX9 what the official MS DX8 and 7 typelibs did, and that is have interfaces for sound AND interfaces for graphics. I assume that DX9 does have sound-based interfaces.
    The last of DirectSound is DirectSound8 shown there. DirectSound9 doesn't exist.

  21. #21
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: [VB6] Direct3D9.

    Quote Originally Posted by The trick View Post
    The last of DirectSound is DirectSound8 shown there. DirectSound9 doesn't exist.
    DirectSound for DirectX9 uses all the same DirectSound8 Interface definitions, plus some bugfixes. (So yeah DirectSound9 doesn't exist)

  22. #22
    Fanatic Member
    Join Date
    Dec 2014
    Posts
    826

    Re: [VB6] Direct3D9.

    im trying to understand how this work and to be able to change my GDI code project to DirectX9 code using "similar" functions that do the same job.
    but to do that, i need to know how this works. the samples have lots of 3D effects while what I need is to load images with alphasetting (png), render those images on a surface and thats it.
    so my question is, what do i need to do to just:

    - Load multiple PNG images (using array)
    - Render any or all of the images on a form, where I can choose x,y,width,height.
    - Cls the form (similar to FillRect+Brush) so that I can make a animation/loop
    - Render a image mirrored (in GDI you can simply make source width/height negative)

  23. #23

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

    Re: [VB6] Direct3D9.

    baka, it's better to use Direct2D for 2d graphics. Of course you can use Direct3D for 2d graphics too.
    For loading a PNG image you can use any code that gets pixels data. Then you should create a texture, lock it in the memory, copy the pixels data there and unlock texture (look the sources where i use textures).
    For rendering on a form, you need to create a quad that represents the rendering surface. Then you need specify the texture coordinates to the quad's vertex (look text rendering source).
    Cls - it just Clear method of IDirect3DDevice9 interface.
    For mirroring you can use many ways, you can just change view matrix, or transform matrix.

  24. #24

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

    Re: [VB6] Direct3D9.

    Update.

    The new examples:
    1. Added simple scene example (camera, procedural generation, mouse picking, basic transformations);
    2. Added "laser lines" example;
    3. Added rendering in different thread example.


    Fixed bugs in the functions:
    1. D3DXMatrixTranspose;
    2. D3DXMatrixRotationQuaternion;
    3. D3DXVec2Length.


    Changes:
    1. Changed function prototype for D3DXPlaneIntersectLine, error raising has been changed to return value;
    2. Changed behavior of function D3DXQuaternionToAxisAngle, now it accepts non-normalized quaternions;




    Enjoy!

  25. #25
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,804

    Re: [VB6] Direct3D9.

    @Trick: The SimpleScene demo is TOTALLY cool. I'll possibly plod along with DX8 for a bit, but you've made the jump to DX9 quite trivial. I can't thank you enough for doing this.

    All The Best Wishes To You,
    Elroy

    EDIT1: Just for others, Trick has included all three of Rotate, Zoom, & Pan for the camera. The Pan is on the middle-mouse button. Because I've got my middle button programmed for something else, I made the following small change to his code in the SimpleScene demo (the frmMain).

    In the picViewport_MouseMove event, I did the following...

    Code:
    
    	' from
    
    ElseIf Button = vbMiddleButton Then
    
    	' to
    
    ElseIf Button = vbLeftButton + vbRightButton Then ' Holding both buttons down.
    
    This allowed me to hold both left-and-right buttons down to get to the pan features.

    Trick, again, this is fabulous stuff.

    EDIT2: Actually, after further reflection (and testing), I changed the entire event to the following:

    Code:
    
    Private Sub picViewport_MouseMove( _
                ByRef Button As Integer, _
                ByRef Shift As Integer, _
                ByRef X As Single, _
                ByRef Y As Single)
        Static fOx  As Single
        Static fOy  As Single
    
        Select Case meCurrentMode
        Case MM_CREATION
    
            ' // Creation stages
            Select Case tObjectCreation.eObject
            Case MM_CREATE_SPHERE
                CreatingSphere X, Y
            Case MM_CREATE_CONE
                CreatingCone X, Y
            Case MM_CREATE_BOX
                CreatingBox X, Y
            End Select
    
        Case Else
    
            ' // Camera movement
            If Button = vbLeftButton Then
    
                mcScene.Camera.RotateRel vec3(-(Y - fOy) / 100, -(X - fOx) / 100, 0)
                Render
    
            ElseIf Button = vbRightButton Then
    
                mcScene.Camera.Zoom -(fOy - Y) / 10
                Render
    
            ElseIf (Button = vbLeftButton + vbRightButton) Or Button = vbMiddleButton Then
    
                mcScene.Camera.Pan -(X - fOx) / 10, (Y - fOy) / 10
                Render
    
            End If
    
        End Select
    
        fOx = X: fOy = Y
    
    End Sub
    
    
    From Trick's original code, this swaps vbLeftButton and vbRightButton. And it also "add" the (Button = vbLeftButton + vbRightButton) to the pan rather than just replacing vbMiddleButton.

    This is the way Vicon Nexus works, which is somewhat an industry standard in displaying mocap data.


    Best Regards,
    Elroy
    Last edited by Elroy; May 7th, 2018 at 07:37 PM.
    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.

  26. #26
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,804

    Re: [VB6] Direct3D9.

    Hi again, Trick.

    Hey, I've got yet another request. However, if you don't already have this, just forget it. You've already done WAY too much for me, and I absolutely love your SimpleScene demo. I've been working with it all day long.

    Ok, here's the request. Do you have a class that's similar to the older cd3dFrame.cls class? In the SimpleScene demo, you give us that CScene.cls, and it does handle "children", but it's not really set up to be nested any further than that. In my situation, I'll be cascading "objects" such that each object defines a local-coordinate-system for all its children. That way, I can do rotations and translations relative to the parent (rather than the "scene") (like reverse kinematics).

    Again, if you don't have it lying around, please, no worries. I'll develop it on my own.


    Also, just another FYI, I noticed that you've got three procedures that deal with Euler angles:
    • modMain.MatrixToEuler
    • D3DX_MATRICES.D3DXMatrixRotationYawPitchRoll
    • D3DX_QUATERNION.D3DXQuaternionRotationYawPitchRoll


    As I'm sure you know, anytime you convert Euler angles to a quaternion (or a transformation matrix), you've got to deal with the X,Y,Z order (and pick one, or let the user specify the order). I haven't studied your code well enough to know which order you picked, but I'll need to allow the user to specify which order they'd like.

    Also, as I'm sure you know, when dealing with Euler angles, we must be careful or we might wind up in a gimbal lock situation.

    I'll probably rewrite those procedures, allowing for the specification of a Euler order. I'll post them when I get it done.

    Again THANK YOU!

    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.

  27. #27

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

    Re: [VB6] Direct3D9.

    Hi Elroy,
    If you want transform an object relative a parent object you just need to combine the two transformation matrix (like i did pivot point, just think about it like parent object and you can make arbitrary number of the chains). Just multiply the transformation to the parent transformation matrix.


    Also, just another FYI, I noticed that you've got three procedures that deal with Euler angles:
    They work like original DirectX functions.
    The order of transformations is roll first, then pitch, then yaw.

  28. #28
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,804

    Re: [VB6] Direct3D9.

    Hi Trick,

    Thanks for that. Yeah, I'm slowly coming to grips with this stuff. It's just a lot of new stuff to learn, not really having swam in the "deep end" of DX stuff before. I'll get there though. And yeah, I saw how you handled the pivot point.

    I'm actually now working on another small problem. I'd like to place a small "World" coordinate system "indicator" up in the top-left corner of my window. I'll get it worked out, but I'll outline the problem to you anyway. Let me start with a little video from some other software to illustrate what I'm talking about:

    Video Here

    It's those three Red,Green,Blue lines (I'm creating three meshes for them). In that software, it's in lower-left, but I like upper-left better as it's more out-of-the-way. Basically, it doesn't scale or pan, but it does rotate. The way I'm approaching the problem is to add functionality to the Camera Class. I've already got a new procedure in it named ViewMatrixFixedDist(nDistance As Single) As D3DMATRIX. Using that for my D3DTS_VIEW matrix of this little coordinate system indicator solves the no-scale problem. If I grab the camera's target position, I can solve the no-pan problem. However, I'm still working on moving it up to the corner. All I know to do is to use the camera's rotation to un-rotate the line-meshes, translate to the corner, and then re-rotate the lines-meshes. And the reason I can't just do it once, is because I want to be able to resize the screen (Viewport). I've already got the resizing working nicely.

    Also, when dealing only with rotations, I'm more used to thinking in terms of quaternions, rather than transformation matrices. Therefore, I put together this little function:

    Code:
    
    Public Sub D3DXVec3ByQuatMultiply(pOut As D3DVECTOR, _
                                      pV As D3DVECTOR, _
                                      pQ As D3DQUATERNION)
        pOut.X = (1! - (pQ.Y * pQ.Y * 2! + pQ.Z * pQ.Z * 2!)) * pV.X + (pQ.X * pQ.Y * 2! - pQ.w * pQ.Z * 2!) * pV.Y + (pQ.X * pQ.Z * 2! + pQ.w * pQ.Y * 2!) * pV.Z
        pOut.Y = (pQ.X * pQ.Y * 2! + pQ.w * pQ.Z * 2!) * pV.X + (1! - (pQ.X * pQ.X * 2! + pQ.Z * pQ.Z * 2!)) * pV.Y + (pQ.Y * pQ.Z * 2! - pQ.w * pQ.X * 2!) * pV.Z
        pOut.Z = (pQ.X * pQ.Z * 2! - pQ.w * pQ.Y * 2!) * pV.X + (pQ.Y * pQ.Z * 2! + pQ.w * pQ.X * 2!) * pV.Y + (1! - (pQ.X * pQ.X * 2! + pQ.Y * pQ.Y * 2!)) * pV.Z
    End Sub
    
    I put it in your D3DX_VECTOR3 module.

    Also, I prefer to write these things as functions, so here's my version of it:

    Code:
    
    Public Function DxVectorByQuatMultiply(uV As D3DVECTOR, uQ As D3DQUATERNION) As D3DVECTOR
        'DxVectorByQuatMultiply.X = (1! - (uQ.Y * uQ.Y * 2! + uQ.Z * uQ.Z * 2!)) * uV.X +       (uQ.X * uQ.Y * 2! - uQ.s * uQ.Z * 2!)  * uV.Y +       (uQ.X * uQ.Z * 2! + uQ.s * uQ.Y * 2!)  * uV.Z
        'DxVectorByQuatMultiply.Y =       (uQ.X * uQ.Y * 2! + uQ.s * uQ.Z * 2!)  * uV.X + (1! - (uQ.X * uQ.X * 2! + uQ.Z * uQ.Z * 2!)) * uV.Y +       (uQ.Y * uQ.Z * 2! - uQ.s * uQ.X * 2!)  * uV.Z
        'DxVectorByQuatMultiply.Z =       (uQ.X * uQ.Z * 2! - uQ.s * uQ.Y * 2!)  * uV.X +       (uQ.Y * uQ.Z * 2! + uQ.s * uQ.X * 2!)  * uV.Y + (1! - (uQ.X * uQ.X * 2! + uQ.Y * uQ.Y * 2!)) * uV.Z
        '
        DxVectorByQuatMultiply.X = (1! - (uQ.Y * uQ.Y * 2! + uQ.Z * uQ.Z * 2!)) * uV.X + (uQ.X * uQ.Y * 2! - uQ.w * uQ.Z * 2!) * uV.Y + (uQ.X * uQ.Z * 2! + uQ.w * uQ.Y * 2!) * uV.Z
        DxVectorByQuatMultiply.Y = (uQ.X * uQ.Y * 2! + uQ.w * uQ.Z * 2!) * uV.X + (1! - (uQ.X * uQ.X * 2! + uQ.Z * uQ.Z * 2!)) * uV.Y + (uQ.Y * uQ.Z * 2! - uQ.w * uQ.X * 2!) * uV.Z
        DxVectorByQuatMultiply.Z = (uQ.X * uQ.Z * 2! - uQ.w * uQ.Y * 2!) * uV.X + (uQ.Y * uQ.Z * 2! + uQ.w * uQ.X * 2!) * uV.Y + (1! - (uQ.X * uQ.X * 2! + uQ.Y * uQ.Y * 2!)) * uV.Z
    End Function
    
    All The Best,
    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.

  29. #29
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,804

    Re: [VB6] Direct3D9.

    WOW, this stuff gets complicated. I managed to get my three little Red,Green,Blue sticks translated up into the top-left corner. However, the camera is now looking "over" at them. I need them rendered as if the camera that "sees the sticks" is normal (orthogonal) to the screen (possibly a second camera, but that sounds like over-kill). I'll get it sorted. I'm just publicly moaning at the complexity of this stuff. And I need to get my head around the secrets embedded in the D3DTS_VIEW, D3DTS_PROJECTION, and D3DTS_WORLD settings.

    Ahhh, I figured it out. It finally dawned on me that this was like a post-render translation. Therefore, I translated the D3DTS_PROJECTION matrix, and voila, I got what I wanted. Of course, I put it back before rendering everything else.
    Last edited by Elroy; May 14th, 2018 at 04:04 PM.
    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.

  30. #30

  31. #31
    New Member
    Join Date
    Sep 2018
    Posts
    4

    Re: [VB6] Direct3D9.

    Dear friends,
    I'm writing a 3D program in VB6 with DirectX9 based on The trick's samples.
    But at certain zooms and perspectives, the mesh that I made looks broken (intermittent) also look jagged at collision of 2 planes

    Name:  Broken_jagged_edges.jpg
Views: 829
Size:  27.8 KB

    I need help, what causes this to happen and how to deal with it?

    thank you

  32. #32

  33. #33
    New Member
    Join Date
    Sep 2018
    Posts
    4

    Re: [VB6] Direct3D9.

    Thanks The trick.. it solved by adjust the z near and z far :
    D3DXMatrixPerspectiveFovLH tMtx, PI / 4, tRC.Right / tRC.Bottom, 50, 100000
    This is because the size of my mesh object is very large

  34. #34
    New Member
    Join Date
    Sep 2018
    Posts
    4

    Re: [VB6] Direct3D9.

    Hello everyone, especially The trick, I found a new problem, when I use :

    m_Direct3DDevice8.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
    m_Direct3DDevice8.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
    m_Direct3DDevice8.SetRenderState D3DRS_ALPHABLENDENABLE, True

    DirectX doesn't drawn the alpha correctly.

    I really need help, what is the solution to this problem?
    All suggestions are highly appreciated.

    I attach the picture :

    Name:  DirectX9 Alpha bug.jpg
Views: 739
Size:  45.0 KB

    Thanks.

  35. #35

  36. #36
    New Member
    Join Date
    Sep 2018
    Posts
    4

    Re: [VB6] Direct3D9.

    Hi @The trick.. thanks for the reply
    Disable the D3DRS_ZENABLE is resolves the alpha problem, but it will cause a new problem,
    where the object that should look in front, it will be blocked with the other behind objects (in several perspectives)
    Microsoft says that we should render it from front to back,
    But it's almost impossible to re-create buffers every time I have to render, those trees are stored in a large enough vertexbuffer with the indices, say.. 300k-500k faces or more, and the position of each tree added randomly

    If I am wrong in interpreting the 'right way' to process the data buffer, please correct me and please teach me the how it should be.

    Thanks

  37. #37
    Lively Member
    Join Date
    Jun 2016
    Posts
    87

    Re: [VB6] Direct3D9.

    Quote Originally Posted by The trick View Post
    It's called z-fighting issue. You can for example move the near plane away from camera to avoid that.
    Hi @the Trick, i am begginer, you know or can make a GraphicsLibary Pure VB6 open-source like Aforge?
    the base of library with cornersDetectors, EdgeDEtectors, Thereshould, some scientifc algorithms, and next, add more features?
    the algorithms of geometry in VB6 is more easy found in web, but the base of library not.
    cheers!

  38. #38
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,804

    Re: [VB6] Direct3D9.

    Quote Originally Posted by xman2000 View Post
    Hi @the Trick, i am begginer, you know or can make a GraphicsLibary Pure VB6 open-source like Aforge?
    the base of library with cornersDetectors, EdgeDEtectors, Thereshould, some scientifc algorithms, and next, add more features?
    the algorithms of geometry in VB6 is more easy found in web, but the base of library not.
    cheers!
    This is basically a duplicate of this post.

    Xman, I don't understand why you feel the need to hijack other off-topic threads. I think you'd have a much better response if you just started your own thread with an outline of your question over in the normal VB6 Q&A section.

    Name:  NewThread.png
Views: 560
Size:  5.7 KB
    Last edited by Elroy; Dec 12th, 2018 at 10:19 AM.
    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.

  39. #39
    Lively Member
    Join Date
    Jun 2016
    Posts
    87

    Re: [VB6] Direct3D9.

    Hi, TheTrick

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

  40. #40

Page 1 of 2 12 LastLast

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