POV-Ray : Newsgroups : povray.advanced-users : Finding an object=B4s location Server Time
25 Nov 2024 03:36:25 EST (-0500)
  Finding an object=B4s location (Message 1 to 8 of 8)  
From: Steely
Subject: Finding an object=B4s location
Date: 17 Nov 2003 20:10:01
Message: <web.3fb9705e4b0664231e2d84430@news.povray.org>
Hi, Boys,

I have this problem for an IRTC entry, but it should be interesting in
general.

I have a scene with, say, a dozen of objects. Every object is built at
<0,0,0> and then translated + rotated the same way: every object gets the
translations+rotations from all objects before plus an additional
translate+rotate.

Is there any way to ask POV-Ray where exactly the last object is located? I
can find its location of course drawing triangles on paper ;-) but I am
looking for some "magic" feature that writes the location directly to the
message window or something else.

TIA for any hints

Rm


Post a reply to this message

From: Slime
Subject: Re: Finding an object=B4s location
Date: 17 Nov 2003 21:08:38
Message: <3fb97f26$1@news.povray.org>
> Is there any way to ask POV-Ray where exactly the last object is located?
I
> can find its location of course drawing triangles on paper ;-) but I am
> looking for some "magic" feature that writes the location directly to the
> message window or something else.


Instead of transforming the object directly, do this:

#declare trans = transformation {
rotate...
scale...
translate...
}

then, use transformation{ trans } to transform the object, and you can also
use the vtransform() function with the same transformation and find the
place where a certain point is transformed to.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Steely
Subject: Re: Finding an object=3DB4s location
Date: 17 Nov 2003 22:45:01
Message: <web.3fb9948fad415b1f1e2d84430@news.povray.org>
Slime wrote:

>use the vtransform() function with the same transformation and find the
>place where a certain point is transformed to.



I thought of vtransform{} and also I thought of min_extent/max_extent as the
doc says in both cases it will return values, but I cannot figure out to

(means, I have no clue how to get it to work correctly).




Do You know of any scene file out there where I can see the code "in
wildlife"?

Thanks

Rm


Post a reply to this message

From: Gilles Tran
Subject: Re: Finding an object=B4s location
Date: 18 Nov 2003 04:15:54
Message: <3fb9e34a$1@news.povray.org>

news:web.3fb9705e4b0664231e2d84430@news.povray.org...

> Is there any way to ask POV-Ray where exactly the last object is located?

The only way I know is to calculate the position using vector functions and
then using the value for screen output.
For example :
#declare
MyPos=vaxis_rotate(vaxis_rotate(<10,30,-20>,y,50)+<50,-10,12>,z,30);
#debug
concat(str(Mypos.x,0,3),",",str(Mypos.y,0,3),",",str(Mypos.z,0,3),"\n")

G.


-- 

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Christopher James Huff
Subject: Re: Finding an object=B4s location
Date: 18 Nov 2003 10:10:32
Message: <cjameshuff-71CABF.10071718112003@netplex.aussie.org>
In article <web.3fb9705e4b0664231e2d84430@news.povray.org>,
 "Steely" <Rob### [at] hamburgde> wrote:

> Is there any way to ask POV-Ray where exactly the last object is located? I
> can find its location of course drawing triangles on paper ;-) but I am
> looking for some "magic" feature that writes the location directly to the
> message window or something else.

What's the location of an object? There is no such thing.


> I thought of vtransform{} and also I thought of min_extent/max_extent as the
> doc says in both cases it will return values, but I cannot figure out to

> (means, I have no clue how to get it to work correctly).

The min_extent() function returns the lower-left-front corner of the 
bounding box of the object, the max_extent() function returns the 
upper-right-back corner. The documentation explains this fully, I 
suggest you read it again. The vtransform() macro (parentheses, not 
curly brackets...it's a macro) transforms a point with a given 
transformation. Pick the point you want to treat as the "center" of the 
object and transform it with the same transformation you used on the 
object.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Steely
Subject: Re: Finding an object=B4s location
Date: 19 Nov 2003 00:23:04
Message: <3fbafe38@news.povray.org>
Gilles Tran wrote:

> #debug
> concat(str(Mypos.x,0,3),",",str(Mypos.y,0,3),",",str(Mypos.z,0,3),"\n")

Yepp. Can't test it right now, (the Windows machine crashed last night) but
this seems to be exactly what I'm looking for.

Merci

Rm


Post a reply to this message

From: Steely
Subject: Re: Finding an object=B4s location
Date: 19 Nov 2003 00:37:15
Message: <3fbb018b@news.povray.org>
Christopher James Huff wrote:

> What's the location of an object? There is no such thing.

Hmmmmmm ....

> The min_extent() function returns the lower-left-front corner of the
> bounding box of the object, the max_extent() function returns the
> upper-right-back corner. The documentation explains this fully, I
> suggest you read it again.

HmHmmHmmm ... If You wanted to name me whatever You succeeded. You also
managed to quote the docs correctly. How about answering the question next
time?

Rm


Post a reply to this message

From: Christopher James Huff
Subject: Re: Finding an object=B4s location
Date: 21 Nov 2003 14:29:56
Message: <cjameshuff-4B66F6.14243821112003@netplex.aussie.org>
In article <3fbb018b@news.povray.org>,
 Steely <rob### [at] hamburgde> wrote:

> > The min_extent() function returns the lower-left-front corner of the
> > bounding box of the object, the max_extent() function returns the
> > upper-right-back corner. The documentation explains this fully, I
> > suggest you read it again.
> 
> HmHmmHmmm ... If You wanted to name me whatever You succeeded.

Er, thank you?


> You also managed to quote the docs correctly. How about answering the 
> question next time?

I did. Your exact question has no answer, because the question itself is 
nonsense, but I gave you two ways of accomplishing your apparent goal. 
To repeat myself: there is no magic way of getting the object's 
"location", because in general, there is no such thing. What's the 
location of a person? Their center of mass? The point in between the 
centers of area of their feet? Or even simpler: what's the location of a 
triangle? A triangle has at least twenty known "centers", starting with 
the incenter, centroid, circumcenter, and orthocenter, and your desired 
"location" may be none of these. 
(http://mathworld.wolfram.com/Center.html, 
http://mathworld.wolfram.com/TriangleCenter.html)

Instead of some mysterious location value, you can get an approximation 
of the extents of the object along each axis, or pick a point to call 
the location of the object and transform that point with the same 
transform you applied to the object.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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