POV-Ray : Newsgroups : povray.binaries.animations : POVigma: I just can't get it right! : Re: POVigma: I just can't get it right! Server Time
23 Apr 2024 21:25:46 EDT (-0400)
  Re: POVigma: I just can't get it right!  
From: "Jörg \"Yadgar\" Bleimann"
Date: 28 Aug 2015 22:40:36
Message: <55e11ba4@news.povray.org>
Hi(gh)!

> You should detect walls' hit, and there is horizontal walls and
> vertical walls. Both are harder to handle with a single dir variable.
>
> Horizontal wall, reflecting the vertical component.
> Vertical wall, reflecting the horizontal component.
>
> Assuming 0 is North, 180 is South, 90 is East.
>
> Horizontal wall: 0->180, 180->0, 90->90, 270->270, 30->150, 80->100

which would yield the formula; dir = 180-dir

> Vertical wall: 0->0, 180->180, 90->270, 270->90, 30->330, 80->280

equalling dir = 360-dir - or just dir = -dir

Meanwhile I found out that my conditions left out the (rare) case that 
the z coordinate of the ball's position in the last frame before 
"entering" a stone is equal to that of the stone's southern face... I 
fixed this (and also re-activated the branch for the vertical walls) and 
now it runs fine (see attached video)!

Thank you for motivating me!

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'povigma_level0001_ballview_0-1_60b.mp4.mpg' (1109 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.