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
    • Register
    • Login

    Raytracing Perspective Glitches?

    Scheduled Pinned Locked Moved SDK Help
    10 Posts 0 Posters 714 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 06/05/2005 at 05:09, xxxxxxxx wrote:

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

      ---------
      Morning!

      I'm currently testing a few shader ideas out using the TraceGeometry command in the VolumeData struct, but am having some weird results. When I transform the current ray for objects near the camera they seem skewed like the scene is being viewed thru a fish-eye lens! Is this a perspective effect, and has anyone experienced this at all?

      Ta

      Dan

      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 09/05/2005 at 01:14, xxxxxxxx wrote:

        no, haven´t experienced this yet.

        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/2005 at 02:35, xxxxxxxx wrote:

          Oh, ok. Might be something to do with the way I'm transforming the ray I guess?

          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/2005 at 06:06, xxxxxxxx wrote:

            Without some more information we'd all be guessing 😉 maybe you could post a code snip or at least what transform you are doing to the ray.

            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 11/05/2005 at 07:40, xxxxxxxx wrote:

              Hi David

              I maybe be doing something really stupid when transforming the ray, perhaps my 3d maths need polishing up a bit! I'll probably need to go into some depth to explain what is going wrong, and you contactable? Or could you mail me please?

              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 11/05/2005 at 07:49, xxxxxxxx wrote:

                You would be better off posting here, this way someone with the right experience might know an answer plus it helps everyone else if they come across a similar problem.

                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 11/05/2005 at 10:24, xxxxxxxx wrote:

                  Ok fair enough. Basically to summarise in a reasonable amount of code ...

                  The code below gets the current ray, transforms it to another objects inverted global matrix (got using ->GetMg), then checks whether the new ray intersects or not (so if hit, col=white, else col=black) - see below :

                  [CODE}
                  Ray *ray, invray;

                  ray = vd->ray;
                  Vector pos = SV(ray->p);
                  Vector dir = SV(ray->v);
                  Vector newpos = globalMat * pos;
                  Vector newdir = globalMat * dir;
                  invray.p = LV(newpos);
                  invray.v = LV(newdir);

                  vd->TraceGeometry(&invray;, MAXREAL, 0, &p;, &n;, &hit;);

                  if(hit)
                  vd->col = Vector(1.0, 1.0, 1.0);
                  else
                  vd->col = Vector(0.0, 0.0, 0.0);

                  ...
                  {/CODE]

                  Does this help explain whats going wrong at all?

                  Cheers ...

                  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 12/05/2005 at 08:37, xxxxxxxx wrote:

                    Hi

                    direction vectors are usually transformed by
                    newdir = dir^globalMat;
                    This omits the translation.

                    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 12/05/2005 at 09:15, xxxxxxxx wrote:

                      Cheers Michael, will give that a go ...

                      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/05/2005 at 01:30, xxxxxxxx wrote:

                        Wow! That worked like a treat. Still a little bit of weirdness going on in the distance, but probably my maths!!

                        Excellent Michael, thanks!

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