On 05/03/2016 at 08:34, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14-17
Platform: Windows ; Mac ;
Language(s) : C++ ;
---------
Hello,
My Video Post plugin renders the objects in a scene in a specific way. It uses VolumeData::GetRay()
and VolumeData::TraceGeometryEnhanced(), then use the SurfaceData::p as input for computing
the color of the current pixel.
Everything works fine with "Perspective" camera projection, but any other mode introduces clipping.
Perspective Render
Isometric Render , similar results in all other projection modes
Code Sample
for (LONG x = 0; x < info.xres; ++x) {
vd->GetRay(x, y, &ray);
BaseTag* tag = nullptr;
Bool hit = false;
RayHitID lhit;
hit = vd->TraceGeometryEnhanced(&ray, MAXREALr, lhit, 0, RAYBIT_0, nullptr, &si);
if (!hit || !si.op || !si.op->link) {
hit = false;
continue;
}
// ....
BaseObject* op = si.op->link;
// ....
Vector p = pns::invert_matrix(op->GetMg()) * si.p - op->GetMp();
Vector col = pns::compute_color(p, pns::equi_rad(op->GetRad()));
Where could the clipping come from? I was hoping this is just me missing some important setting
or so. If it is not so simple, I'll be able to write a full example that reproduces the problem on
another day.
Thanks a lot in advance!
Niklas