Hair and TraceRay
-
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));
> }
> }
> }
> }
> }
> _ -
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?