POV-Ray : Newsgroups : povray.newusers : vector math / transforms : Re: vector math / transforms Server Time
13 May 2024 22:56:09 EDT (-0400)
  Re: vector math / transforms  
From: Warp
Date: 3 Aug 2013 16:12:08
Message: <51fd6418@news.povray.org>
Bald Eagle <cre### [at] netscapenet> wrote:
> I want to scale a vector.
> What is the directive and syntax to do this?
> Say, "squash" vector <-1, -1, 0> so it's <-1, 0.5, 0>
> I'd like to operate on the whole vector, rather than do something like
> <vector.x/2, vector.y, vector.z> "by hand"

You can multiply vectors in the same way as number, with '*'.
(It will simply multiply each vector component with each other.)

For example <1, 2, 3> * <1, 0.25, 1> = <1, 0.5, 3>

-- 
                                                          - Warp


Post a reply to this message

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