Results 1 to 2 of 2

Thread: Sphere Texturing

  1. #1

    Sphere Texturing

    Hi Petr, All
    i refer to your example Tga_Masking in the TBGL_BonusPack_1_6_0_10 can be found in this path: TBGL_BonusPack_1_6_0_10\SpecialEffects\Tga_Masking
    it is a great example and can be utilized to encode secret messages such as yours hand written "alpha" word. i have tried it with another tga picture archaic.tga to give the impression of old memories in another universe, i found the picture on my hard disk with another name.
    just before a minute i was about to ask you a question and now i found the solution, but i have decided to continue my post.
    the question was that i want to put a sphere in the middle of this archaic device, but when i want to use the tbgl_color 0,255,255 before it all the archaic device colored with cyan color like the ball. but now i found that putting tbgl_color 255,255,255 ie color white at the beginning of the loop will cancel the cyan color effect.
    i begins to read about alpha channel and its usage.
    attached Petr example (the outside sphere only) with the archaic picture. or you can download the example from the TBGL_BonusPack_1_6_0_10
    arch.jpg
    Attached Files Attached Files

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

    thanks for interesting modification, it looks good! Interesting thing is that you can encode multiple messages to single image via Alpha channel, and then control how much of them will be visible by carefully increasing/decreasing parameter for TBGL_AlphaFunc.

    The root of your problem was the fact, that TBGL (and OpenGL) works like state machine - that means if you define color, it is not used just for next geometric primitive, but to all what follows until you change it to something else.

    I see this OpenGL feature can be source of trouble in many situations, that is why I introduced TBGL-specific functions such as TBGL_PushStateProtect/TBGL_PopStateProtect and TBGL_PushState/TBGL_PopState. I will investigate if I can bring something similar related to color.


    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

Similar Threads

  1. looking for sphere
    By largo_winch in forum Shout Box Area
    Replies: 7
    Last Post: 17-04-2011, 19:03
  2. Sphere physics
    By Petr Schreiber in forum TBGL General
    Replies: 39
    Last Post: 20-07-2008, 16:24

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
  •