Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Why is my texture not showing

  1. #1

    Why is my texture not showing

    Hi Petr,

    could you please have a look at my attached code and tell me why the hell the texture of the trackelement isn't shown? I can't see the silly mistake I make here. If I use that model inside another code, it works there but I think all the setup and rendering is the same. Obviously it isn't but I can't see why.

    Michael
    Edit: attached version with the changes Michael suggested
    Attached Files Attached Files

  2. #2

    Re: Why is my texture not showing

    Also where should I place a call of TBGL_MouseGetWheelDelta in the code to get a result? I placed it inside the Render_01 function but it doesn't return anything besides 0.

  3. #3
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: Why is my texture not showing

    I have something like this before its to do with trying to work with TBGL before creating the window.

    in this case find the chunk of code after you setup the menus and things. Then create your models.

    [code=thinbasic] DIALOG SET MINSIZE hDlg, 400, 350
    TBGL_TestFunction = "Render_01"
    TBGL_BINDCANVAS( hCtrl )

    modelDIR = dir_getcurrent & "models\"
    textureDIR = dir_getcurrent & "textures\"
    msgbox(0,modelDIR & $CRLF & textureDIR)
    If modelDIR <> "" Then
    NumberofFiles = DIR_ListArray(TheFileList, modelDIR, "*.m15", %FILE_NORMAL Or %FILE_ADDPATH)

    tbgl_m15InitModelBuffers NumberofFiles, 2000

    maxElements = NumberofFiles
    FOR count = 1 TO MaxElements
    vList( Count ) = file_pathsplit(TheFileList(count), %Path_File)
    tbgl_m15LoadModel TheFileList(count), "textures\", Count, Count, %TBGL_NORMAL_smooth
    NEXT
    if count >= 1 then partno = 1

    DIALOG SHOW MODAL hDlg, CALL DlgProc
    END FUNCTION[/code]

    hope that helps
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  4. #4
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: Why is my texture not showing

    TBGL_MouseGetWheelDelta

    Restrictions

    This functionality is not available for canvas, only for TBGL window
    Its all the help mike :P
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  5. #5

    Re: Why is my texture not showing

    Thanks Mike, but that didn't change anything. :'(

  6. #6
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: Why is my texture not showing

    Try this mike.

    Attached Files Attached Files
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  7. #7

    Re: Why is my texture not showing

    : Doooh, I give up coding. Thanks for the file. Your first suggestion works perfect, once I remove the TBGL_M15LOADMODEL from its old location.
    Thank you!!!

  8. #8
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Why is my texture not showing

    Hi,

    I am sorry to reply late again but Monday - Thursday I am from morning to late afternoon in school with no chance to get on the net.

    MichaelAbraxas is right, all you need to do is to move code after creation of TBGL_CreateWindowEx or TBGL_BindCanvas. In other cases the OpenGL context is not active.

    All mouse functionalities should work for control. Just that mouse wheel breaks the party.
    The solution is to handle %WM_MOUSEWHEEL in dialog callback on your own.

    [code=thinbasic]
    CASE %WM_MOUSEWHEEL
    Delta = HIWRD(CBWPARAM)
    IF Delta/120 = Delta\120 THEN
    Delta = 1
    ELSE
    Delta = -1
    END IF
    [/code]

    I will add this workaround to help file immediately, I am very sorry I made you scratch your head
    I attach code for you.

    Petr

    UPDATED
    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

  9. #9

    Re: Why is my texture not showing

    Thanks, no problem. Mike was a great help.

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Why is my texture not showing

    Here is version with wheel for you,
    the editor looks very promising by the way


    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

Page 1 of 2 12 LastLast

Similar Threads

  1. email address showing
    By efly2020 in forum General
    Replies: 5
    Last Post: 21-01-2009, 23:33

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
  •