POV-Ray : Newsgroups : povray.advanced-users : Finding unknown coordinates Server Time
25 Nov 2024 17:33:34 EST (-0500)
  Finding unknown coordinates (Message 1 to 7 of 7)  
From: Rohan Bernett
Subject: Finding unknown coordinates
Date: 30 Jul 2002 00:03:02
Message: <web.3d460fb5e47fbcc2d02c7b870@news.povray.org>
I have a simple (and crappy) scene of what is supposed to be an elliptical
galaxy. The galaxy is made by randomly translating and rotating 15000 white
spheres with ambient 1.

What I need help with, is finding the coordinates of the translated and
rotated sphere, so I can then translate it by a fraction of its y-value to
squash the shape of the galaxy without distorting the shapes of the stars.

Can anyone help?

Rohan _e_ii


Post a reply to this message

From: Simon Adameit
Subject: Re: Finding unknown coordinates
Date: 30 Jul 2002 02:57:14
Message: <3d4638ca@news.povray.org>
"Rohan Bernett" wrote:
>
> What I need help with, is finding the coordinates of the translated and
> rotated sphere, so I can then translate it by a fraction of its y-value to
> squash the shape of the galaxy without distorting the shapes of the stars.
>
Why don't you do it when you place them?


Post a reply to this message

From: ABX
Subject: Re: Finding unknown coordinates
Date: 30 Jul 2002 05:43:08
Message: <3hnckuotcr4vk7edsp3qu8h43856a7v56h@4ax.com>
On Tue, 30 Jul 2002 00:01:57 EDT, "Rohan Bernett" <rox### [at] yahoocom> wrote:
> I have a simple (and crappy) scene of what is supposed to be an elliptical
> galaxy. The galaxy is made by randomly translating and rotating 15000 white
> spheres with ambient 1.
>
> What I need help with, is finding the coordinates of the translated and
> rotated sphere, so I can then translate it by a fraction of its y-value to
> squash the shape of the galaxy without distorting the shapes of the stars.
>
> Can anyone help?

Here is solution to your problem:

#version 3.5;
#include "transforms.inc"
#declare Center=<...>;
#declare Transform=transform{translate .. rotate ... scale ... matrix ...};
sphere{ Center Radius transform{ Transform } }
#declare NewCenter = vtransform(Center, transform{ Transform } );

BTW: If you are posting here becouse only here you can find advanced users you
are wrong. Such newbie question should be posted in povray.newusers group IMO.

ABX


Post a reply to this message

From: Rohan Bernett
Subject: Re: Finding unknown coordinates
Date: 4 Aug 2002 05:10:16
Message: <web.3d4cee86511b82d02c120f590@news.povray.org>
Simon Adameit wrote:

>Why don't you do it when you place them?

That is basically what I am trying to do.

The code which places the star is this:

 object{star
   translate 1*< randomness*(rand(S1)-0.5), randomness*(rand(S1)-0.5),
randomness*(rand(S1)-0.5)>
   rotate <(rand(S1)-0.5)*360, (rand(S1)-0.5)*360, (rand(S1)-0.5)*360>
   translate <0,0.5,0>
   pigment{rgb<1,1,(rand(S1)*0.9)>}
   }

If I knew where the star was after all these random transforms, it would be
easy, but I don't. Is there a method of doing something like this:
"translate -1*(this.y/2)" ?

Rohan _e_ii


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: Finding unknown coordinates
Date: 4 Aug 2002 05:57:22
Message: <3d4cfa82@news.povray.org>
"Rohan Bernett" <rox### [at] yahoocom> schrieb im Newsbeitrag
news:web.3d4cee86511b82d02c120f590@news.povray.org...

> If I knew where the star was after all these random transforms, it would
be
> easy, but I don't. Is there a method of doing something like this:
> "translate -1*(this.y/2)" ?

Just do the translations and rotations on some variable with the
vector-functions. Than translate the star to that position and keep it's
position in the variable.

Marc-Hendrik


Post a reply to this message

From: hughes b
Subject: Re: Finding unknown coordinates
Date: 4 Aug 2002 06:58:47
Message: <3d4d08e7@news.povray.org>
I think you could use vtransform() macro from transforms.inc [take a look at
the Scene Help at section 7.19]. By using that you should get a final
vector, I believe, and then use it to do a further change. Speak up please,
anyone, if I'm mistaken.

You might also try declaring your transformation stuff into a 'transform'
statement. Not sure what your whole scene is doing but if that is reused a
lot it could be beneficial, I'm not sure how the multiple instances would
behave as far as parse times go.

P.S.

BTW, if you are out there reading this *ingo* and you are still
neverendingly cleaning the Help files up... I see a typo in that vtransform
macro part of section 7.19. The word "tranlate", missing a "s".

Elsewhere, the Point_At_Trans(YAxis) has the word Axis to describe the
workings of that macro and it seems to me it should still be saying YAxis
instead. Checking the include file, that also states it as Axis and not
YAxis in the comment. Maybe only a matter of how you interprete things but I
thought of it as another different "axis" at first read.

Also the Axial_Scale_Trans(Axis, Amt) part has a non-blue Amt in the
description, needing a <code>Amt</code> as I look at the source just now.

Lets see, what else might there be... oh yeah...  :-)
Reorient_Trans(Axis1, Axis2). The part:
Axis2 = Vectors to be rotated towards. Plural of vector, is that right (or
wrong)?

Sorry to be picking out so much in so little space of the Scene Help at this
point in time. Somebody has to I guess. Most the time I scan over things so
quick I am lucky to catch mistakes.


Post a reply to this message

From: Rohan Bernett
Subject: Re: Finding unknown coordinates
Date: 4 Aug 2002 21:05:14
Message: <web.3d4dce22511b82d018ccf4f70@news.povray.org>
Speaking of errors in the help files, the section about the IRTC "cdrom's"
has some misused apostrophes. Whoever wrote the help files doesent seem to
know when to use an apostrophe. :-)

It should say "CDROMs" not "CDROM's". You are supposed to use an apostrophe
in either the posessive case, or in a contraction. And where it is used in
this case in incorrect, as you are only giving a plural in this case.

Why this error is so common I can't understand. *sigh*

Rohan _e_ii


Post a reply to this message

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