POV-Ray : Newsgroups : povray.advanced-users : difficult questions (for me anyway) Server Time
11 Oct 2026 19:19:31 EDT (-0400)
  difficult questions (for me anyway) (Message 1 to 22 of 22)  
From: Mick Hazelgrove
Subject: difficult questions (for me anyway)
Date: 8 Mar 2000 11:48:51
Message: <38c68473@news.povray.org>
I've two questions:

I have a cylinder from 0 to x*1, rotate it randomly around the y axis. Can I
find the xyz values of the end point that was x*1?

If so: I make a second cylinder from this point to x*2 and rotate it
randomly - does it rotate around zero or around the end point of cylinder
one? If it rotates around zero how can I make it rotate around the end of
cylinder one? do I have to translate it to zero, then rotate it, then
translate it to the end of cylinder one?

loop back to question one!

Hope that makes sense

Mick

--
*************************************************************
       http://www.minda.swinternet.co.uk/index.htm

*************************************************************


Post a reply to this message

From: Lars Luthman
Subject: Re: difficult questions (for me anyway)
Date: 8 Mar 2000 12:11:02
Message: <38c689a6$1@news.povray.org>
Mick Hazelgrove skrev i meddelandet <38c68473@news.povray.org>...

>I have a cylinder from 0 to x*1, rotate it randomly around the y axis. Can
I
>find the xyz values of the end point that was x*1?


I don't think that's possible, if you don't calculate the random value and
save it in a variable before you rotate the cylinder, like this:

#declare R = rand();
rotate <0, R, 0>

Then you can calculate the new endpoint using sin() and cos().


>I make a second cylinder from this point to x*2 and rotate it
>randomly - does it rotate around zero or around the end point of cylinder
>one?

Yes, everything rotates around <0, 0, 0> in POV.


If it rotates around zero how can I make it rotate around the end of
>cylinder one? do I have to translate it to zero, then rotate it, then
>translate it to the end of cylinder one?


Yeah.


--ll


Post a reply to this message

From: Nieminen Juha
Subject: Re: difficult questions (for me anyway)
Date: 8 Mar 2000 12:19:55
Message: <38c68bbb@news.povray.org>
Lars Luthman <no### [at] spamse> wrote:
: #declare R = rand();
: rotate <0, R, 0>

: Then you can calculate the new endpoint using sin() and cos().

  Or more easier with vrotate().


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: difficult questions (for me anyway)
Date: 8 Mar 2000 13:13:23
Message: <38c69843@news.povray.org>
>   Or more easier with vrotate().


Please explain, for me and for other maths disadvantaged pov users!

--
*************************************************************
       http://www.minda.swinternet.co.uk/index.htm

*************************************************************


Post a reply to this message

From: mr art
Subject: Re: difficult questions (for me anyway)
Date: 8 Mar 2000 13:38:06
Message: <38C69E24.E80E6439@gci.net>
From the docs:

vrotate(A,B) 
Rotate A about origin by B. 
Given the x,y,z coordinates of a point in space designated 
by the vector A, rotate that point about the origin by an 
amount specified by the vector B. Rotate it about the x-axis 
by an angle specified in degrees by the float value B.x. 
Similarly B.y and B.z specify the amount to rotate in degrees 
about the y-axis and z-axis. The result is a vector containing 
the new x,y,z coordinates of the point.


A contains a point reference
B contains a rotation reference.
The function vrotate(A,B) returns the new point reference 
if you rotate point A by rotation B.

i.e. point{<0,0,0> translate A rotate B}

I know that there is no object called point{ <location>
[OBJECT_MODIFIERS...] }
but it does help to use it in this way with translate and rotate .

Mick Hazelgrove wrote:
> 
> >   Or more easier with vrotate().
> 
> Please explain, for me and for other maths disadvantaged pov users!
> 
> --
> *************************************************************
>        http://www.minda.swinternet.co.uk/index.htm
> 
> *************************************************************

-- 
Mr. Art

"Often the appearance of reality is more important 
than the reality of the appearance."
Bill DeWitt 2000


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: difficult questions (for me anyway)
Date: 8 Mar 2000 14:07:53
Message: <38c6a509@news.povray.org>
Thanks everybody, problem solved.

Mick

--
*************************************************************
       http://www.minda.swinternet.co.uk/index.htm

*************************************************************
"mr.art" <mr.### [at] gcinet> wrote in message news:38C69E24.E80E6439@gci.net...
> From the docs:
>
> vrotate(A,B)
> Rotate A about origin by B.
> Given the x,y,z coordinates of a point in space designated
> by the vector A, rotate that point about the origin by an
> amount specified by the vector B. Rotate it about the x-axis
> by an angle specified in degrees by the float value B.x.
> Similarly B.y and B.z specify the amount to rotate in degrees
> about the y-axis and z-axis. The result is a vector containing
> the new x,y,z coordinates of the point.
>
>
> A contains a point reference
> B contains a rotation reference.
> The function vrotate(A,B) returns the new point reference
> if you rotate point A by rotation B.
>
> i.e. point{<0,0,0> translate A rotate B}
>
> I know that there is no object called point{ <location>
> [OBJECT_MODIFIERS...] }
> but it does help to use it in this way with translate and rotate .
>
> Mick Hazelgrove wrote:
> >
> > >   Or more easier with vrotate().
> >
> > Please explain, for me and for other maths disadvantaged pov users!
> >
> > --
> > *************************************************************
> >        http://www.minda.swinternet.co.uk/index.htm
> >
> > *************************************************************
>
> --
> Mr. Art
>
> "Often the appearance of reality is more important
> than the reality of the appearance."
> Bill DeWitt 2000


Post a reply to this message

From: Mike Williams
Subject: Re: difficult questions (for me anyway)
Date: 8 Mar 2000 15:20:01
Message: <pwldTMAYWrx4EwnE@econym.demon.co.uk>
Wasn't it Mick Hazelgrove who wrote:

>I make a second cylinder from this point to x*2 and rotate it
>randomly - does it rotate around zero or around the end point of cylinder
>one? If it rotates around zero how can I make it rotate around the end of
>cylinder one? do I have to translate it to zero, then rotate it, then
>translate it to the end of cylinder one?

You can get it to behave either way. You just have to configure things
right. If you want cylinder 2 to rotate about the end of cylinder 1,
then define them something like this:-


#declare Forearm = cylinder {0,x,...
  rotate <...>  // elbow
}

#declare WholeArm = union {
  cylinder {0,x,...}
  object {Forearm translate x}
  rotate <...>  // shoulder
}

The rotate instruction attached to Forearm rotates it about the elbow,
and the rotate instruction attached to WholeArm rotates the whole arm
about the shoulder keeping the elbow joint connected.

In general, the trick is to create the objects with the rotation point
at zero, apply the rotation, then perform the translation to where you
really want them later. In this way you can keep adding more sections to
the hierarchy and they'll all hang together and rotate correctly about
the joints you create.

-- 
Mike Williams * ##
Gentleman of Leisure


Post a reply to this message

From: David Fontaine
Subject: Re: difficult questions (for me anyway)
Date: 8 Mar 2000 23:38:18
Message: <38C729F2.FF588583@faricy.net>
Mick Hazelgrove wrote:

> I've two questions:
>
> I have a cylinder from 0 to x*1, rotate it randomly around the y axis. Can I
> find the xyz values of the end point that was x*1?

cylinder { <0,0,0>,<1,0,0>,n rotate bla*y } //correct?
then the end point will be <sin(bla),0,cos(bla)>

> If so: I make a second cylinder from this point to x*2 and rotate it
> randomly - does it rotate around zero or around the end point of cylinder
> one? If it rotates around zero how can I make it rotate around the end of
> cylinder one? do I have to translate it to zero, then rotate it, then
> translate it to the end of cylinder one?

Unfortunately, yes. Maybe I should add arbitrary origin to those macros... :-)

--
___     _______________________________________________
 | \     |_          <dav### [at] faricynet> <ICQ 55354965>
 |_/avid |ontaine        http://www.faricy.net/~davidf/

"The only difference between me and a madman is that I'm not mad." -Dali


Post a reply to this message

From: Nieminen Juha
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 03:17:10
Message: <38c75e06@news.povray.org>
Mick Hazelgrove <mha### [at] mindaswinternetcouk> wrote:
: Please explain, for me and for other maths disadvantaged pov users!

  As mr. art said, there's this thing called "documentation". Ever heard
about it?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 03:27:47
Message: <38C7611A.C08BD85@pacbell.net>
Nieminen Juha wrote:
> 
> Mick Hazelgrove <mha### [at] mindaswinternetcouk> wrote:
> : Please explain, for me and for other maths disadvantaged pov users!
> 
>   As mr. art said, there's this thing called "documentation". Ever heard
> about it?

I have but without the proper educational background there are times it
makes absolutely no sense what so ever. An example is sometimes worth
1000 documented words. If a person had understood the original explaination
they would not have asked for clarification. What is easy for you may be
difficult for others. Not every thing in POV-Ray is inherently obvious
or intuitive. We are here to help not criticize. Dare to teach so that
others may learn. Patients is a virtue. Lead by example. Give till it
hurts.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Marc Schimmler
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 04:40:35
Message: <38C77193.C429545C@ica.uni-stuttgart.de>
Ken wrote:
> 
> I have but without the proper educational background there are times it
> makes absolutely no sense what so ever. An example is sometimes worth
> 1000 documented words. If a person had understood the original explaination
> they would not have asked for clarification. What is easy for you may be
> difficult for others. Not every thing in POV-Ray is inherently obvious
> or intuitive. We are here to help not criticize. Dare to teach so that
> others may learn. Patients is a virtue. Lead by example. Give till it
> hurts.
> 

The virtues of a noble POVer ... I wonder if you have sworn an oath for
it.

:-)

Thank you Ken!  I really mean it.

Marc


-- 
Marc Schimmler


Post a reply to this message

From: Chris Huff
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 04:54:49
Message: <chrishuff_99-543B15.04563509032000@news.povray.org>
In article <38C729F2.FF588583@faricy.net>, David Fontaine 
<dav### [at] faricynet> wrote:

> cylinder { <0,0,0>,<1,0,0>,n rotate bla*y } //correct?
> then the end point will be <sin(bla),0,cos(bla)>

I prefer:
cylinder { <0,0,0>,<1,0,0>,n rotate bla*y}
The end point will be vrotate(<1,0,0>, bla*y)

Note that your solution should be <sin(degrees(bla)), 0, 
cos(degrees(bla))>, unless you specify your angles in radians. But 
vrotate works for any rotation, instead of just a rotation around an 
axis, so I would recommend you use it. It also makes your code easier to 
figure out when you come back to it after abandoning it for a week.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ken
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 06:18:00
Message: <38C788FF.E25C883C@pacbell.net>
Marc Schimmler wrote:

> The virtues of a noble POVer ... I wonder if you have sworn an oath for
> it.

Well I do swear from time to time...

> Thank you Ken!  I really mean it.

  Well thank you for thanking me. Looking back to all of the questions
I have answered and all of the people I have helped I am satisfied with
the contributions I have made to the POV-Ray community. At other times
I wonder if I have done enough. Was my help needed ? Were my answers
good enough ? Should I have tired harder, written more, and explained
better ? All I can really do is contribute what I can and hope that
others share what they know when they too have the opportunity to.


-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Bouf
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 06:32:05
Message: <38C78FBC.E0929D84@nanterre.marelli.fr>
Chris Huff wrote:
> 
> Note that your solution should be <sin(degrees(bla)), 0,
> cos(degrees(bla))>, unless you specify your angles in radians. But

It should be <sin(radians(bla), 0, cos(radians(bla)))>, isn't it ?
Assuming bla is in degrees...

Bouf.


Post a reply to this message

From: Chris Huff
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 07:00:17
Message: <chrishuff_99-A18175.07020309032000@news.povray.org>
In article <38C78FBC.E0929D84@nanterre.marelli.fr>, Bouf 
<Chr### [at] nanterremarellifr> wrote:

> Chris Huff wrote:
> > 
> > Note that your solution should be <sin(degrees(bla)), 0,
> > cos(degrees(bla))>, unless you specify your angles in radians. But
> 
> It should be <sin(radians(bla), 0, cos(radians(bla)))>, isn't it ?
> Assuming bla is in degrees...

Er, yes. My explanation? I was only on my second cup of coffee this 
morning. :-)

Oh, another way to do it(assuming you are using MegaPOV) would be 
vtransform(<1,0,0>, rotate bla*y). Not necessarily the best way in this 
case, but if you are using several transformations in a row, you can 
#declare them as a transform and use that to modify both the object and 
the vector. Like this:

#declare Vect = < 1, 0, 0>;
#declare Trans =
transform {
    rotate, scale, translate...
}

object {MyObj
    transform {Trans}
}
#declare startVect = vtransform(Vect, Trans);

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ron Parker
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 08:17:58
Message: <38c7a486$1@news.povray.org>
On Thu, 09 Mar 2000 00:30:18 -0800, Ken wrote:
>Patients is a virtue.

Especially if you happen to be a doctor or a dentist.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Nieminen Juha
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 11:01:17
Message: <38c7cacc@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: We are here to help not criticize.

  I apologize.
  It's just that sometimes the RTFM-mentality hits me when something looks
so simple (to me) in the manual.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 11:44:14
Message: <38c7d4de@news.povray.org>
Thanks again for your help.

The trig solution should have been obvious but for some reason didn't occur
to me in this context.

Vector math is something we did not study 45years ago when I was at school
and I have had little time to try and understand it since. I have learnt
allot from this discussion about vrotate and have solved my original problem
now, using both vrotate and trig.

One last point. Many of us do not work in environments full of high powered
mathematical brains and computer gurus - we rely on this news groups to help
us understand. I for one thank you for all your patience.

Mick
--
*************************************************************
       http://www.minda.swinternet.co.uk/index.htm

*************************************************************
"Chris Huff" <chr### [at] yahoocom> wrote in message
news:chrishuff_99-A18175.07020309032000@news.povray.org...
> In article <38C78FBC.E0929D84@nanterre.marelli.fr>, Bouf
> <Chr### [at] nanterremarellifr> wrote:
>
> > Chris Huff wrote:
> > >
> > > Note that your solution should be <sin(degrees(bla)), 0,
> > > cos(degrees(bla))>, unless you specify your angles in radians. But
> >
> > It should be <sin(radians(bla), 0, cos(radians(bla)))>, isn't it ?
> > Assuming bla is in degrees...
>
> Er, yes. My explanation? I was only on my second cup of coffee this
> morning. :-)
>
> Oh, another way to do it(assuming you are using MegaPOV) would be
> vtransform(<1,0,0>, rotate bla*y). Not necessarily the best way in this
> case, but if you are using several transformations in a row, you can
> #declare them as a transform and use that to modify both the object and
> the vector. Like this:
>
> #declare Vect = < 1, 0, 0>;
> #declare Trans =
> transform {
>     rotate, scale, translate...
> }
>
> object {MyObj
>     transform {Trans}
> }
> #declare startVect = vtransform(Vect, Trans);
>
> --
> Chris Huff
> e-mail: chr### [at] yahoocom
> Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Josh English
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 12:09:00
Message: <38C7DB6A.F2F34FA4@spiritone.com>
There is a brief visual explanation here:
http://www.spiritone.com/~english/cyclopedia/vrotate.html

hopefully this helps. If not, please send me osme feedback so I can make
this more useful for people

Josh
Mick Hazelgrove wrote:

> >   Or more easier with vrotate().
>
> Please explain, for me and for other maths disadvantaged pov users!
>
> --
> *************************************************************
>        http://www.minda.swinternet.co.uk/index.htm
>
> *************************************************************

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From: Margus Ramst
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 17:33:58
Message: <38C82748.F7A08FF1@peak.edu.ee>
Ken wrote:
> 
> I have but without the proper educational background there are times it
> makes absolutely no sense what so ever. An example is sometimes worth
> 1000 documented words.

There are some vector math examples (in the animations section, I believe). I
really recommend anybody who has trouble understanding the maths render those
examples since, as you say, they are worth a 1000 words.
Heck, they even helped me understand what vdot does. No verbal explanation had
managed to do that.
Perhaps similar examples should be added to encompass more functions. The one
Mick mentioned seems a common requirement.

Margus


Post a reply to this message

From: David Fontaine
Subject: Re: difficult questions (for me anyway)
Date: 9 Mar 2000 18:32:06
Message: <38C833B5.111745F5@faricy.net>
Chris Huff wrote:

> Note that your solution should be <sin(degrees(bla)), 0,
> cos(degrees(bla))>, unless you specify your angles in radians.

Oh yeah, forgot. That's such a pain in the arse.
What's so great about radians anyway? That the arc length of one radian is
the radius? Some magical property of pi? Why do mathematicians always seem
to prefer radians to degrees?

--
___     _______________________________________________
 | \     |_          <dav### [at] faricynet> <ICQ 55354965>
 |_/avid |ontaine        http://www.faricy.net/~davidf/

"The only difference between me and a madman is that I'm not mad." -Dali


Post a reply to this message

From: Mark Wagner
Subject: Re: difficult questions (for me anyway)
Date: 10 Mar 2000 00:26:20
Message: <38c8877c@news.povray.org>
David Fontaine wrote in message <38C833B5.111745F5@faricy.net>...
>What's so great about radians anyway? That the arc length of one radian is
>the radius? Some magical property of pi? Why do mathematicians always seem
>to prefer radians to degrees?


Because calculus works out much better if you use radians.

Mark


Post a reply to this message

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