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

    Hair and TraceRay

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 199 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 30/10/2007 at 11:29, xxxxxxxx wrote:

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

      ---------
      I'm having a problem using HairVideoPost::TraceRay.

      p and v appear valid, but hit and d are not being assigned anything and TraceRay returns -1 (NOTOK?).

      I am testing it in a scene with the Hair post effect set to Raytrace.

      Here's some sample code in VideoPostData::Execute
      What am I doing wrong here?

      > _
      > if ((vps- >vp==VP_INNER) && (vps->open) && (!vps->thread->TestBreak())) {
      >      HairVideoPost* hairvp = (HairVideoPost* )vps->vd->FindVideoPost(VPhair);
      >
      >      if (hairvp&&hairvp-;>TracerEnabled()) {
      >           RayParameter *ray = vps->vd->GetRayParameter();
      >           if (ray) {
      >                LONG x,y;
      >
      >                Ray hray;
      >                Vector p;
      >                Vector v;
      >                Vector hit;
      >                Real d;
      >                LONG result;
      >
      >                for (y=ray->top; y<=ray->bottom; y++) {
      >                     for (x=ray->left; x<=ray->right; x++) {
      >                          vps->vd->GetRay(x, y, &hray;);
      >
      >                          p.x = hray.p.x; p.y = hray.p.y; p.z = hray.p.z;
      >                          v.x = hray.v.x; v.y = hray.v.y; v.z = hray.v.z;
      >
      >                          result = hairvp->TraceRay(p, v, hit, d, vps->vd->GetCurrentCPU(), 100000.0);
      >
      >                          GePrint(LongToString(result));
      >                     }
      >                }
      >           }
      >      }
      > }
      > _

      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 13/11/2007 at 13:59, xxxxxxxx wrote:

        Can anyone confirm that this is not working?

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