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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Transform to the Screen Coordinate

    SDK Help
    0
    3
    371
    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/09/2003 at 03:00, xxxxxxxx wrote:

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

      ---------
      I want to make points transform to the Screen Coordinate like BaseView.WS().
      But my function written below returns wrong value when the point is
      at near or  at behind the Camera.
      What is wrong?
      void WorldToScreen( VolumeData* vd, RyaObject* op Vector* point )
      {
       RayCamera rc = vd->GetRayCamera();
       Matrix                    cm = rc->m;
       Vector                   v;
       cm = !cm;
       for( LONG i = 0; i < op->pcnt; i++ )
       {
        v = op->padr[i];
        v = im * v;
        v = vd->CameraToScreen( v );
        point[i] = v;
       }
      }

      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/09/2003 at 23:47, xxxxxxxx wrote:

        My compiler fails already at RyaObject, so it's hard to tell... 😉
        But to the point. The code for WorldToCamera() and CameraToScreen() has been posted at the old forum: <[URL-REMOVED]>
        As you can see, it performs no clipping. Could this be why you get wrong results? You'd have to clip manually at z<0.0, I believe.


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

        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/09/2003 at 03:39, xxxxxxxx wrote:

          Thanks for your  advice.
          I forget to clip -Z point.
          Now my function work correctly.

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