POV-Ray : Newsgroups : povray.off-topic : Vector math question.. Server Time
7 Sep 2024 07:22:32 EDT (-0400)
  Vector math question.. (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Patrick Elliott
Subject: Re: Vector math question..
Date: 25 Aug 2008 22:11:16
Message: <48b36644$1@news.povray.org>
scott wrote:
> This should work, it totally negates the direction of the wind force if 
> hitting the "front" of the object.
> 
> objnorm = VecNorm(GetRot);
> dot = wind.x * objnorm.x + wind.y * objnorm.y + + wind.z * objnorm.z;
> if dot < 0
>   wind = -wind;
> SetForce (wind);
> 
> Or did you want only the component of the wind perpendicular to the wall 
> to be negated?
> 
> if dot < 0
>   Wind = wind - 2 * dot * objnorm;
> 
> Or did you want the component of wind perpendicular to the wall to be 
> zero (as I think John explained)?
> 
> if dot < 0
>   Wind = wind - dot * objnorm;
> 
Actually, these are helpful, especially since they explain where I got 
something wrong about what the dot product does... Nimrods on the 
explanation pages for their system describe * as the dot product 
function, but then show you doing stuff like <0.54,0.0,0.0,-0.3> * 
<1,2,3> and still ending up with a 4 argument vector, not a single 
float... Real confusing if you don't know how dumb it is.

As for what I would like to do. Either a) make the component 
perpendicular to the wall zero, *OR* a better option, since such things 
still billow and move when blow on directly too, "reverse" the part 
perpendicular to the wall, so it acts as though the wind was blowing 
from the opposite direction. Thus, either one of your last two solution 
is the right one. Well, except for the lame ass fact that I am not sure 
I can multiply a vector and a number and get a vector, instead of the 
engine whining about invalid types.. However, I think that only happens, 
absurdly enough, when multiplying two non-rotation vectors (i.e., those 
not yet converted to quaternions. A conversion that, ironically, would 
render the information worthless in the context I need to use it, since 
the force vector isn't a rotation... :p)

Anyway. Thanks. I kind of figured that doubling the value would reverse 
it, rather than just zeroing it, but the two contradictory definitions 
of what the frack dot product meant was throwing me off. Now that I 
think of what it actually does, its bloody obvious.

-- 
void main () {

     if version = "Vista" {
       call slow_by_half();
       call DRM_everything();
     }
     call functional_code();
   }
   else
     call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models, 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: Patrick Elliott
Subject: Re: Vector math question..
Date: 25 Aug 2008 22:12:01
Message: <48b36671$1@news.povray.org>
Warp wrote:
> Patrick Elliott <sel### [at] npgcablecom> wrote:
>> Uh, wait.. Thought dot product in this case was the equivalent of matrix 
>> multiplication, that page implies that the vector results in a single 
>> value, not another vector... So, what I posted in my second reply to 
>> John was wrong?
> 
>   You are probably confusing it with the cross-product.
> 
They are confusing it with cross-product. Guess their Wiki has it wrong. :(

-- 
void main () {

     if version = "Vista" {
       call slow_by_half();
       call DRM_everything();
     }
     call functional_code();
   }
   else
     call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models, 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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