Results 1 to 6 of 6

Thread: TBGL_EntityGetMatrix* by Joshy

  1. #1

    TBGL_EntityGetMatrix* by Joshy

    %ORDER_ROWCOL = 0
    %ORDER_COLROW = 1

    TBGL_EntitySetMatrix4x4(byval SceneID, byval EntityID, byref Array4x4 [,Order])
    TBGL_EntityGetMatrix4x4(byval SceneID, byval EntityID, byref Array4x4 [,Order])

    TBGL_EntitySetMatrix3x3(byval SceneID, byval EntityID, byref Array3x3 [,Order])
    TBGL_EntityGetMatrix3x3(byval SceneID, byval EntityID, byref Array3x3 [,Order])

    in most cases the data type of matrix should be float not double

    thank you

    Joshy
    (Sorry about my bad English.)

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_EntityGetMatrix* by Joshy

    Hi Joshy,

    I split this topic so I have one request in one thread, much easier to follow.
    As I said, TBGL_EntityGetMatrix awaits you in next update.

    These special syntax variants are interesting, I will consider them for 2.x release of TB.

    The thing is that thinBASIC SDK allows you to detect how many elements the passed array has, so maybe just single function for Get and Set will be necessary.


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_EntityGetMatrix* by Joshy

    By row-column you mean the matrix will be:

    Xx, Xy, Xz, 0
    Yx, Yy, Yz, 0
    Zx, Zy, Zz, 0
    Px, Py, Pz, 1


    And column-row this?:

    Xx, Yx, Zx, Px
    Xy, Yy, Zy, Py
    Xz, Yz, Zz, Pz
    0, 0, 0, 1


    The 4x4 set/get matrix functions might make it to 1.8, but I would need help from you in form of intensive testing. Otherwise I will leave it for 2.x.

    For 3x3, I presume they would hold "local x,y,z axes" only?


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4

    Re: TBGL_EntityGetMatrix* by Joshy

    2D arrays in C/C++ have an other order as in most BASIC languages.
    (of course 1D arrays are allways the same )

    array(3,3) ' BASIC
    1,1, 1,2, 1,3 = address in memory 0,1,2
    2,1, 2,2, 2,3 = address in memory 3,4,5
    3,1, 3,2, 3,3 = address in memory 6,7,8

    array[3,3] ' C
    1,1, 2,1, 3,1 = address in memory 0,3,6
    1,2, 2,2, 3,2 = address in memory 1,4,7
    1,3, 2,3, 3,3 = address in memory 2,5,8

    Is TBGL written in C/C++ or Power/Free BASIC ?

    Joshy
    (Sorry about my bad English.)

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_EntityGetMatrix* by Joshy

    Hi,

    it is powerBasic powered.

    Here is the updated DLL.

    It should support Get/Set for both 4x4 and 3x3 matrices, the command detects the size of array automagically.

    How to use? Few examples:
    [code=thinbasic]
    Dim Matrix4by4(4,4) As Single
    Dim Matrix3by3(3,3) As Single

    ' -- Pass matrix 4x4 in row-col order
    TBGL_EntityGetMatrix(%sScene, %eBox, Matrix4by4(1, 1), %TBGL_RowColumn)

    ' -- Pass matrix 4x4 in col-row order
    TBGL_EntityGetMatrix(%sScene, %eBox, Matrix4by4(1, 1), %TBGL_ColumnRow)

    ' -- Pass matrix 3x3 in row-col order
    TBGL_EntityGetMatrix(%sScene, %eBox, Matrix3by3(1, 1), %TBGL_RowColumn)

    ' -- Pass matrix 3x3 in col-row order
    TBGL_EntityGetMatrix(%sScene, %eBox, Matrix3by3(1, 1), %TBGL_ColumnRow)
    [/code]
    ... and the same for Set.

    I am reallocating to uni, so I will be able to react back later today.

    I would appreciate your tests, if ok, then I will document it and add to 1.8


    Thanks,
    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,157
    Rep Power
    736

    Re: TBGL_EntityGetMatrix* by Joshy

    Feature developed and documented,
    will be present in ThinBASIC 1.8.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. Joshy - cars
    By D.J.Peters in forum TBGL module by Petr Schreiber
    Replies: 1
    Last Post: 04-03-2010, 16:44

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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