POV-Ray : Newsgroups : povray.newusers : User-defined vector functions Server Time
28 Jul 2024 18:25:15 EDT (-0400)
  User-defined vector functions (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Mathuin
Subject: Re: User-defined vector functions
Date: 8 Oct 2008 14:20:00
Message: <web.48ecf92117cb998c401d7400@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "Mathuin" <mat### [at] gmailcom> wrote:
> > I used to think I knew more about POV-Ray than I apparently do.  Either that, or
> > this new project is introducing me to new corners of SDL and other interesting
> > things.
> >
> > I find myself making sets of user-defined float functions because I can't figure
> > out how to make a user-defined vector function.  I end up with stuff like this:
> >
> > #declare LocX = function(x) { x + 1 }
> > #declare LocY = function(y) { y * 2 }
> > #declare LocZ = function(z) { z / 3 }
> >
> > I'd *much* rather have this:
> >
> > #declare LocXYZ = function(x, y, z) { <x + 1, y * 2, z / 3> }
> >
> > Any chance there's an easy way to do this?  Will I have to use a macro?
>
> A macro is best suited for this:
>
> #macro LocXYZ (x0,y0,z0)
>   #local x1=x0+1;
>   #local y1=y0*2;
>   #local z1=z0/3;
>   <x1,y1,z1>
> #end
>
> evaluate using:
>
> #declare A=LocXYZ(1,2,3);

This is pretty much what I ended up doing, for what it's worth.  Thank you for
doing what I forgot to do -- provide a useful answer for those who come to the
forums later trying to avoid asking the same questions I asked.

>
>
> -tgq


Post a reply to this message

From: Mathuin
Subject: Re: User-defined vector functions
Date: 8 Oct 2008 14:30:00
Message: <web.48ecfbd617cb998c401d7400@news.povray.org>
andrel <a_l### [at] hotmailcom> wrote:
> I haven't looked into the docs for macros and functions recently (and if
> I did I would not be able to judge anymore anyway), but if they behave
> like ordinary docs, you can not read them unless you know what is in
> there. Mathuin first posted in this group 3 days ago. In general people
> wait for at least one or two weeks before posting, so I guess he*
> discovered POV about 2-3 weeks ago. There will be a lot of trivial
> things he does not know yet, like reading the examples in the source
> directories and looking in p.t.s-f and p.t.t for inspiration. You can
> blame him for not knowing these things, you can blame him for not even
> trying, but that is simply not fair. Friendly point him in the right
> direction and he'll study the docs before asking the next question and
> he'll be back within two months with a stunning picture. Attack his lack
> of knowledge and he won't come back ever again because he'll get the
> impression that POV is too difficult for him. We don't want that, do we?
>
> * or she

I've been tinkering with POV-Ray since the first IRTC disk went on sale over a
decade ago, but most of what I did was render other people's scene files and
ooh and ah over them.  A few years ago I started working on a project which was
actually interesting and useful but very limited due to my own lack of
experience.  Usenet has been essentially dead to me for almost as long as I've
been tinkering with POV-Ray, so it didn't occur to me to search for groups like
this until very recently when I picked up that project again and was
disappointed by how I'd left it.  I re-examined the POV-Ray website, found the
newsgroups, and jumped on board, searching for answers before posting when
feasible (and when I remembered *blush*) and trying to find a solution to my
problems.

With the help of the answers I have received and some of the posts I've browsed,
not only have I improved the quality of my rendering I have also improved the
speed by between fifteen and twenty-five percent.  I haven't yet learned
anything new this time around about constructive solid geometry, but the
advances I've made in understanding "all the stuff that starts with #" have
been pretty impressive.  I'm no longer cutting and pasting from other files and
trying to figure out what people are doing -- I'm reading the SDL docs and
actually trying things and it's going great guns.  I've run up against another
problem which I couldn't answer over the past few days and I'll be posting
about that momentarily but this is really the last little wrinkle before I can
post it.

The group as a whole has been very helpful.  Thank you all, even you, Thorsten,
for your help.


Post a reply to this message

From: Jim Holsenback
Subject: Re: User-defined vector functions
Date: 8 Oct 2008 15:26:16
Message: <48ed0958@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message 
news:48eceeaf@news.povray.org...
> My post was no RTFM. But I guess you just want to flame me, so by all 
> means, have your fun - assholes.
>
> Thorsten

Take a deep breath and repeat after me .... "It's only a news group" ;-)


Post a reply to this message

From: andrel
Subject: Re: User-defined vector functions
Date: 8 Oct 2008 16:45:51
Message: <48ED1C4D.1000306@hotmail.com>
On 08-Oct-08 20:28, Mathuin wrote:
> andrel <a_l### [at] hotmailcom> wrote:
> I've been tinkering with POV-Ray since the first IRTC disk went on sale over a
> decade ago, but most of what I did was render other people's scene files and
> ooh and ah over them.  A few years ago I started working on a project which was
> actually interesting and useful but very limited due to my own lack of
> experience.  Usenet has been essentially dead to me for almost as long as I've
> been tinkering with POV-Ray, so it didn't occur to me to search for groups like
> this until very recently when I picked up that project again and was
> disappointed by how I'd left it.  I re-examined the POV-Ray website, found the
> newsgroups, and jumped on board, searching for answers before posting when
> feasible (and when I remembered *blush*) and trying to find a solution to my
> problems.

I think that only makes your comments even more valuable. If even after 
some years of (mostly passive, but still) exposure to POV some things 
are illogical then there is definitely room for improvement in POV4.

> The group as a whole has been very helpful.  Thank you all, even you, Thorsten,
> for your help.

Thorsten can be very helpful. You just have to know that if he doesn't 
want to, he absolutely will make that clear. He is even known to swear 
sometimes when he feels misunderstood. Sometimes his behaviour suggests 
that he is a acting out a personal vendetta against some (mostly) 
innocent person. Again, he isn't, but you have to be a regular to know that.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: User-defined vector functions
Date: 8 Oct 2008 17:24:09
Message: <48ed24f9$1@news.povray.org>
Jim Holsenback wrote:
> "Thorsten Froehlich" <tho### [at] trfde> wrote in message 
> news:48eceeaf@news.povray.org...
>> My post was no RTFM. But I guess you just want to flame me, so by all 
>> means, have your fun - assholes.
>>
>> Thorsten
> 
> Take a deep breath and repeat after me .... "It's only a news group" ;-) 

LOL, indeed it is  -- if the people who spend a hundred lines flaming me had 
spend their time on writing examples, guess what difference _they_ could 
have made ...

	Thorsten


Post a reply to this message

From: Tim Attwood
Subject: Re: User-defined vector functions
Date: 8 Oct 2008 19:04:40
Message: <48ed3c88$1@news.povray.org>
>> I find myself making sets of user-defined float functions because I can't 
>> figure
>> out how to make a user-defined vector function.  I end up with stuff like 
>> this:
>>
>> #declare LocX = function(x) { x + 1 }
>> #declare LocY = function(y) { y * 2 }
>> #declare LocZ = function(z) { z / 3 }
>>
>> I'd *much* rather have this:
>>
>> #declare LocXYZ = function(x, y, z) { <x + 1, y * 2, z / 3> }
>>
>> Any chance there's an easy way to do this?  Will I have to use a macro?
>
> A macro is best suited for this:
>
> #macro LocXYZ (x0,y0,z0)
>  #local x1=x0+1;
>  #local y1=y0*2;
>  #local z1=z0/3;
>  <x1,y1,z1>
> #end
>
> evaluate using:
>
> #declare A=LocXYZ(1,2,3);
>
You can represent simple linear equations as transforms...

#declare LocXYZ = function {
   transform {
      scale <1,2,1/3>
      translate <1,0,0>
   }
};

For more complex equations you are stuck using macros, splines, or pigments.


Post a reply to this message

From: Stephen
Subject: Re: User-defined vector functions
Date: 9 Oct 2008 06:02:22
Message: <3jlre4lu57667uienohe737te1oc2l82sa@4ax.com>
On Wed, 08 Oct 2008 19:32:37 +0200, Thorsten Froehlich <tho### [at] trfde> wrote:

>Stephen wrote:
>> And RTFM is so bad mannered, 
>
>My post was no RTFM. But I guess you just want to flame me, so by all means, 
>have your fun - assholes.
>
>	Thorsten

Well you guess wrong, Thorsten. I don't consider it a Flame but a request not to
reply to people who post in the newusers group with generalised suggestions to
review the documentation. You are right your post was not a RTFM but it reads
like a "put down" never the less.
Please remember that you are one of the Architects/Developers of PovRay, (we see
your name every time we start PovRay) and you are someone to look up to. Someone
whose opinion means a lot. This gives you a position in the community whether
you like it or not. Like Andrel I realise that your writing style is different
from most of us here and you probably do not mean to sound hostile and that you
have ameliorated it over the years. 
As for being an arsehole (I prefer the British version it sounds less wishy
washy than the American "asshole"), yes I can be and I am sure that I will be
will be in the future whenever the need arises. Pal.
-- 

Regards
     Stephen


Post a reply to this message

From: Kenneth
Subject: Re: User-defined vector functions
Date: 11 Oct 2008 15:00:01
Message: <web.48f0f5fc17cb998c78dcad930@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> Stephen wrote:
> > And RTFM is so bad mannered,
>
> My post was no RTFM. But I guess you just want to flame me, so by all means,
> have your fun - assholes.
>
>  Thorsten

That was uncalled for.  Especially from a POV team member. We're all here to
learn and help, not to be abused.

Ken Walker


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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