Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Visual Aid

    SDK Help
    0
    46
    33.4k
    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
      Helper
      last edited by

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

      On 24/08/2009 at 09:31, xxxxxxxx wrote:

      Figured it out. Thanks,

      ~Shawn

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

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

        On 24/08/2009 at 10:41, xxxxxxxx wrote:

        Anyone know how i could make the polygon I create appear somewhat translucent?

        ~Shawn

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

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

          On 24/08/2009 at 10:56, xxxxxxxx wrote:

          Figure this out too.. LOL.. guess I'll stop asking until I really try to figure it out. HAHA..   Thanks everyone.

          This was accomplished using SetTransparency ()

          ~Shawn

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

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

            On 24/08/2009 at 10:57, xxxxxxxx wrote:

            BaseDraw::SetTransparency(LONG trans) with negative values for trans.

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

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

              On 24/08/2009 at 11:50, xxxxxxxx wrote:

              Well , I was hoping I wouldn't have to ask again. LOL but can someone point me in the right direction on how to be able to take the color selected from a COLOR selector in the attributes manager and turning that into the color values for the polygon3D()..

              Thanks,

              ~Shawn

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

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

                On 24/08/2009 at 11:58, xxxxxxxx wrote:

                Vector color = bc->GetVector(YOUR_DESC_FOR_THE_COLOR);

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

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

                  On 24/08/2009 at 12:00, xxxxxxxx wrote:

                  Thanks Robert, As always. Top Notch!

                  ~Shawn

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

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

                    On 24/08/2009 at 21:00, xxxxxxxx wrote:

                    Finally, the last step I need to do is to get the polygon that I have created, aligned, resized, and changed the color, to stay locked to the object on which the tag is.

                    For example, this portion of my plugin creates a visible symmetry plane on an object. I would like this new polygon to stay attached to the object no matter where it is moved around in 3d space. Can someone point me in the right direction on how to accomplish this?

                    Thanks,

                    ~Shawn

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

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

                      On 25/08/2009 at 01:44, xxxxxxxx wrote:

                      Multiply the position vectors of the polygon with the global matrix of the object.

                      Btw. I recommend to really go through the SDK examples as they often provide a solution to your problem.

                      cheers,
                      Matthias

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

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

                        On 25/08/2009 at 09:25, xxxxxxxx wrote:

                        Thanks Matthias.   I have been looking through them they are very helpful. I didn't find one that showed how to do this. Is there one specific example I should look at?

                        ~Shawn

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

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

                          On 25/08/2009 at 09:48, xxxxxxxx wrote:

                          In this case it's just basic vector/matrix algebra. The examples are full of it. If you haven't done it yet I recommend to get familiar with vector/matrix algebra. There is an excellent introduction in the COFFEE documentation called " Using matrices".

                          cheers,
                          Matthias

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

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

                            On 25/08/2009 at 10:10, xxxxxxxx wrote:

                            I'm not finding Using Matrices in the COFFEE documentation.   hmmm..

                            ~Shawn

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

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

                              On 25/08/2009 at 10:26, xxxxxxxx wrote:

                              Please download the CINEMA 4D R9.5 COFFEE docu.

                              older sdk downloads

                              cheers,
                              Matthias

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

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

                                On 25/08/2009 at 10:35, xxxxxxxx wrote:

                                Thanks Matthias!

                                ~Shawn

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

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

                                  On 25/08/2009 at 14:20, xxxxxxxx wrote:

                                  Okay I have got the plane following the object using the objects matrix. Now I need to figure out how to rotate the plane using the matrix of the object? I am confused because while the baseobject has a SetRot() function, the BaseDraw class does not, What equation would I use to convert the vectors I recieve from the GetRot() from the BaseObject to the vectors that are used to draw the Polygon3D() ?

                                  Thanks in advance.

                                  ~Shawn

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

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

                                    On 25/08/2009 at 14:55, xxxxxxxx wrote:

                                    Create a rotation matrix and apply it before applying the global matrix to the vectors. MatrixRotX(), MatrixRotY(), MatrixRotZ() are what you need to look for. If you are going to use the vector values from GetRot(), simply use HPBToMatrix(). I see that it now has specific rotation orders as well (this is new in R11!). I would stick with ROT_HPB in this situation. 🙂

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

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

                                      On 25/08/2009 at 17:34, xxxxxxxx wrote:

                                      This is what I do to get my global matrix to maintain the position of the polygon.

                                      > `

                                        
                                      \>  Matrix matrix = op->GetMg(); // Get the global matrix  
                                      \>  Vector globalPos = matrix.off; // Get the position from the matrix  
                                      \>  
                                      

                                      `

                                      Then in the vectors I put...
                                      > `

                                        
                                      \>  Vector p[4] = { Vector(-lngMaxX-100+globalPos.x,-lngMaxY-100+globalPos.y,0+globalPos.z),Vector(-lngMaxX-100+globalPos.x,lngMaxY+100+globalPos.y,0+globalPos.z),Vector(lngMaxX+100+globalPos.x,lngMaxY+100+globalPos.y,0+globalPos.z),Vector(lngMaxX+100+globalPos.x,-lngMaxY-100+globalPos.y,0+globalPos.z)};   
                                      \>  
                                      

                                      `

                                      lngMaxX, lngMaxY, and lngMaxZ are the greatest point on each of those axis.

                                      So to create the rotation matrix I would do this?
                                      > `

                                        
                                      \>  Vector rot = op->GetRot();  
                                      \>  Matrix rotation = HPBToMatrix(rot, ROT_HPB);  
                                      \>  
                                      

                                      `

                                      Then what do I add to my vectors?

                                      Thanks,

                                      ~Shawn

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

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

                                        On 25/08/2009 at 19:25, xxxxxxxx wrote:

                                        Vector p[4] = ???;
                                        p[4] = p[4] * rotation;

                                        You'll have to initialize the vectors to the plane point values first (???).

                                        You can't 'add' rotations to a point. It must be a matrix multiplication.

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

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

                                          On 25/08/2009 at 19:37, xxxxxxxx wrote:

                                          Okay I have this to declare necessary variables and set up matrices

                                          > `

                                            
                                          \>       //Used to lock the poistion of the visualized symmetry plane to the object   
                                          \>       Matrix matrix = op->GetMg(); // Get the global matrix  
                                          \>      Vector globalPos = matrix.off; // Get the position from the matrix  
                                          \>         
                                          \>       Matrix m = op->GetMg();  
                                          \>       Vector rot = op->GetRot();  
                                          \>       GePrint ("The Rotation Coordinates are... " + RealToString(rot.x) + RealToString(rot.y) + RealToString(rot.z));  
                                          \>       Matrix rotation = HPBToMatrix(rot, ROT_HPB);  
                                          \>  
                                          

                                          `

                                          And this is where it all gets it's values.

                                          > `

                                            
                                          \>            Vector p[4] = { Vector(-lngMaxX-100+globalPos.x,-lngMaxY-100+globalPos.y,0+globalPos.z),Vector(-lngMaxX-100+globalPos.x,lngMaxY+100+globalPos.y,0+globalPos.z),Vector(lngMaxX+100+globalPos.x,lngMaxY+100+globalPos.y,0+globalPos.z),Vector(lngMaxX+100+globalPos.x,-lngMaxY-100+globalPos.y,0+globalPos.z)};  
                                          \>            p[4] = p[4] * rotation;  
                                          \>            Vector f[3] = { Vector(color),Vector(color),Vector(color)};  
                                          \>            bd->SetLightList(BDRAW_SETLIGHTLIST_NOLIGHTS);  
                                          \>            bd->SetTransparency(trans);  
                                          \>            bd->Polygon3D(p,f,TRUE);  
                                          \>    
                                          \>  
                                          

                                          `

                                          As it is , when I added p[4] = p[4] * rotation;

                                          It crashes.

                                          Do you see anything wrong?

                                          Thanks,

                                          ~Shawn

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

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

                                            On 25/08/2009 at 20:40, xxxxxxxx wrote:

                                            You have four vectors there. p[4] is an invalid index. Sorry if my pseudo-code was confusing. You need to matrix multiply each individual vector:

                                            p[0] = p[0] * rotation;
                                            p[1] = p[1] * rotation;
                                            p[2] = p[2] * rotation;
                                            p[3] = p[3] * rotation;

                                            You should also be doing the matrix multiplication before the other stuff though. This is why I put in ??? instead of that complex position math. 🙂 Typical order of applying transformations is scale->rotation->position. This keeps the scale and rotation with respect to the object's origin.

                                            It looks like you are using +100 and -100 as the initial plane vector values. Start with the defaults, multiply by the rotation matrix and thenadd in the other values.

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