Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    DrawTexture in DRAWPASS_HANDLES [SOLVED]

    Scheduled Pinned Locked Moved SDK Help
    10 Posts 0 Posters 741 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 05/05/2011 at 07:43, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R12.043 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi everybody,
      I want to Display some text on screen which only should be drawn when my object is selected. To achieve this I create a GeClipMap at Viewport-resolution and draw the strings onto it. At the end I draw it on Screen using the DrawTexture function. This works fine in DRAWPASS_OBJECT but in DRAWPASS_HANDLES nothing is drawn on screen.
      Thanks for any help!
      Satara

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 05/05/2011 at 09:23, xxxxxxxx wrote:

        Yes that is right. What exactly is your question?

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 05/05/2011 at 16:14, xxxxxxxx wrote:

          Is it not possible to use drawtexture in drawpass_handles?

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 05/05/2011 at 17:18, xxxxxxxx wrote:

            Apparently not. 🙂 Didn't work for me either.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 06/05/2011 at 01:52, xxxxxxxx wrote:

              ok thanks!

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 10/05/2011 at 01:14, xxxxxxxx wrote:

                Another problem:
                How can I draw the Text in front of the geometry (with drawtexture)?
                This is how it looks currently:

                here is the code:
                DRAWRESULT Draw(BaseObject *op, DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh) {
                if (drawpass == DRAWPASS_OBJECT)
                {
                ....
                // render the clip map to the viewport
                bd->SetMatrix_Screen();
                bd->SetLightList(BDRAW_SETLIGHTLIST_NOLIGHTS);
                Vector pnts[4] = { Vector(0, 0, 0), Vector(0, height, 0), Vector(width, height, 0), Vector(width, 0, 0) };
                Vector cols[4] = { Vector(1, 1, 1), Vector(1, 1, 1), Vector(1, 1, 1), Vector(1, 1, 1) };
                Vector nrms[4] = { Vector(0, 0, -1), Vector(0, 0, -1), Vector(0, 0, -1), Vector(0, 0, -1) };
                Vector uvs[4] = { Vector(0, 0, 0), Vector(0, 1, 0), Vector(1, 1, 0), Vector(1, 0, 0) };
                bd->DrawTexture(clipMap->GetBitmap(), pnts, cols, nrms, uvs, 4, DRAW_ALPHA_NORMAL, DRAW_TEXTUREFLAGS_INTERPOLATION_NEAREST);
                ...
                }

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 17/05/2011 at 03:55, xxxxxxxx wrote:

                  Draw it in the handles drawing pass. Also make sure to use a clockwise texture polygon e.g. { Vector(0,0,0), Vector(1,0,0), Vector(1,1,0), Vector(0,1,0) }.

                  Example:

                    
                  DRAWRESULT RoundedTube::Draw(BaseObject *op, DRAWPASS drawpass, BaseDraw *bd, BaseDrawHelp *bh)  
                  {  
                    if (drawpass!=DRAWPASS_HANDLES) return DRAWRESULT_SKIP;  
                    
                    bd->SetLightList(BDRAW_SETLIGHTLIST_NOLIGHTS);  
                    
                    bd->SetMatrix_Screen();  
                    
                    Vector padr[4] = { Vector(200,200,0), Vector(300,200,0), Vector(300,300,0), Vector(200,300,0) };  
                    Vector cadr[4] = { Vector(1,1,1), Vector(1,1,1), Vector(1,1,1), Vector(1,1,1) };  
                    Vector nadr[4] = { Vector(0,0,-1), Vector(0,0,-1), Vector(0,0,-1), Vector(0,0,-1) };  
                    Vector uvadr[4] = { Vector(0,0,0), Vector(1,0,0), Vector(1,1,0), Vector(0,1,0) };  
                    
                    bd->DrawTexture(bmp, padr, cadr, nadr, uvadr, 4, DRAW_ALPHA_NONE, DRAW_TEXTUREFLAGS_0);  
                    
                    return DRAWRESULT_OK;  
                  }  
                  

                  cheers,
                  Matthias

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 17/05/2011 at 04:53, xxxxxxxx wrote:

                    Ah! Cool. thx, very good to know 🙂

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 17/05/2011 at 12:39, xxxxxxxx wrote:

                      Looks perfect, thx a lot Matthias!

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        Helper
                        last edited by

                        On 06/08/2014 at 19:40, xxxxxxxx wrote:

                        Hi All, but if is draw in the Handle time, the texture will be not visibile if the object is not selected.

                        regards
                        Renato

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post