Results 1 to 16 of 16

Thread: Simple 3D display OCX

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    8

    Question Simple 3D display OCX

    Greetings.

    I am a beginning code developer, long-time basic user, but just becoming familiar with .NET environment and application development.

    I am beginning PhD work in metrology. One application we are looking at is using laser to measure surface points of a part. This results in a set of 3D points (Point cloud - 100 to 1000000 independent coordinates).

    I would like to find or create an ActiveX control to display this set of points in manipulable 3D environment window (with size, position and rotation controls).

    I would like to investigate finding source for purchased OCX of this type, but also will develop a simple model so I understand the mechanics.

    Can anyone give me benefit of their experience with simple 3D graphic display and/or OCX outsourcing?

    I have also asked this in "Graphics Inquiry" thread.

    Thanks!
    Laine

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I think Direct3D in VB is easy enough that you can use it directly.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    8
    Thanks for the quick response.

    Any links to simple examples?
    Laine

  4. #4
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    Great tutorials here - http://www.directx4vb.com/

  5. #5
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by Machaira
    Great tutorials here - http://www.directx4vb.com/
    Jack Hoxley is actually a member here... though he doesnt post very much... Im sure DX4VB keeps him quite busy =).

    I would have to agree, the site is simply wonderful for the tutorials =).

    Z.

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    8

    Simple 3D display OCX [RESOLVED]

    Thank you. My next questions will be much more detailed.

    - L
    Laine

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    8

    DirectX4VB Tutorial

    I am currently undertaking DirextX8: DirectX Graphics: Getting Started tutorial from directx4vb.com (recommended from vbworld.com). As this tutorial is written in VB6, I have had to do some translation.

    Most is ok, but I am hitting a runtime error in the Initialise function, particularly the line

    Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, FrmMain.Hwnd, _
    D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)

    Which I translated to VB.Net as

    D3DDevice = D3D.CreateDevice(DxVBLibA.CONST_D3DCONST.D3DADAPTER_DEFAULT, DxVBLibA.CONST_D3DDEVTYPE.D3DDEVTYPE_HAL, Nothing, DxVBLibA.CONST_D3DCREATEFLAGS.D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)

    The error text is

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Laines 3D Display.exe
    Additional information: Exception from HRESULT: 0x8876086C.


    Am I missing something in the .Net translation? Has anyone submitted .Net translations to any of these basic graphics tutorials? (I feel I can translate ok, it's just tedious)

    Also, are there existing OCX controls that utilize D3D, something I could incorporate directly to my project without having to manually code the whole thing?


    btw, these tutorials look like the best on the net!
    Laine

  8. #8
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    DX8 doesn't have 'fully handled .NET code' or something like that. That may be your problem, I don't know.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You need a hwnd to pass. You can't just pass Nothing, you need a fully qualified HWND. You can get one from any Control object using the Handle property, but you'll most likely want to use the main Form of your app.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    8
    ok, now I used the main form.activeform.handle.toint32 property


    my error is more simple now:

    An unhandled exception of type 'System.NullReferenceException' occurred in Laines 3D Display.exe

    Additional information: Object reference not set to an instance of an object. (occurs at


    how do I create a new instance of the hardware adapter (I think this is a peculiarity of .NET)?

    I have attached my code (translation of Jack's tutorial lesson).

    Thanks for the help with what i'm sure are simple questions for you!

    Laine
    Attached Files Attached Files
    Laine

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    (occurs at
    Does it say where?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    8
    excuse please


    the error occurs in the line used to create the hw adapter:

    '//This line will be explained in detail in a minute...
    '??? D3DDevice = New DxVBLibA.Direct3D8()

    D3DDevice = D3D.CreateDevice _(DxVBLibA.CONST_D3DCONST.D3DADAPTER_DEFAULT, _
    DxVBLibA.CONST_D3DDEVTYPE.D3DDEVTYPE_HAL, _
    Form1.ActiveForm.Handle.ToInt32, _
    DxVBLibA.CONST_D3DCREATEFLAGS.D3DCREATE_SOFTWARE_VERT _
    EXPROCESSING, D3DWindow)


    I need to create a new instance of the adapter.
    This is runtime error; compile is ok.



    On a broader subject, am I barking up the wrong tree trying to go this in VB.NET? It looks to me like current state of online support is strong in VB6, with little or no .NET support. What do you think?
    Laine

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yes, absolutly. VB.NET is too young for that many people to pick it up well enough that they can explain it to others.

    Are you sure
    Form1.ActiveForm
    isn't Nothing?
    Try
    Form1.Handle
    instead.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Atlanta
    Posts
    8
    handle.toint32 returns a valid value
    but now i'm back to the original error:

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Laines 3D Display.exe
    Additional information: Exception from HRESULT: 0x8876086C.

    which occurs at the same line of code:

    D3DDevice = D3D.CreateDevice(DxVBLibA.CONST_D3DCONST.D3DADAPTER_DEFAULT, DxVBLibA.CONST_D3DDEVTYPE.D3DDEVTYPE_HAL, Handle.ToInt32, DxVBLibA.CONST_D3DCREATEFLAGS.D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)


    i'm searching local help now


    btw, i ordered vb6 standard today

    L
    Laine

  15. #15
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    D3DERR_INVALIDCALL
    The method call is invalid. For example, a method's parameter may have an invalid value.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  16. #16
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    But don't ask me which.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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