POV-Ray : Newsgroups : povray.general : access object attributes Server Time
25 Nov 2024 19:45:16 EST (-0500)
  access object attributes (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: s day
Subject: access object attributes
Date: 15 May 2013 13:20:01
Message: <web.5193c3ba1e039d0c3449e5060@news.povray.org>
Hi,

Is it possible to access an object attributes (position).

e.g.

I have declared an object that is an intersection of several objects and
translated it to a location. This object is held in an array.

Can I then access the x, y, z location of that object somehow?

Thanks

Seanb


Post a reply to this message

From: Nekar Xenos
Subject: Re: access object attributes
Date: 15 May 2013 13:38:42
Message: <op.ww4zasp7ufxv4h@xena>
On Wed, 15 May 2013 19:19:54 +0200, s.day <s.d### [at] uelacuk> wrote:

> Hi,
>
> Is it possible to access an object attributes (position).
>
> e.g.
>
> I have declared an object that is an intersection of several objects and
> translated it to a location. This object is held in an array.
>
> Can I then access the x, y, z location of that object somehow?
>
> Thanks
>
> Seanb
>

ObjectCenter = min_extent(Object)+.5*(max_extent(Object)-minExtent(Object))


-- 
-Nekar Xenos-


Post a reply to this message

From: s day
Subject: Re: access object attributes
Date: 15 May 2013 14:55:01
Message: <web.5193d9d98cb402123449e5060@news.povray.org>
"Nekar Xenos" <nek### [at] gmailcom> wrote:
> On Wed, 15 May 2013 19:19:54 +0200, s.day <s.d### [at] uelacuk> wrote:
>
> > Hi,
> >
> > Is it possible to access an object attributes (position).
> >
> > e.g.
> >
> > I have declared an object that is an intersection of several objects and
> > translated it to a location. This object is held in an array.
> >
> > Can I then access the x, y, z location of that object somehow?
> >
> > Thanks
> >
> > Seanb
> >
>
> ObjectCenter = min_extent(Object)+.5*(max_extent(Object)-minExtent(Object))
>
>
> --
> -Nekar Xenos-

Thanks, just what I needed.

Sean


Post a reply to this message

From: Nekar Xenos
Subject: Re: access object attributes
Date: 15 May 2013 15:15:58
Message: <op.ww43svktufxv4h@xena>
On Wed, 15 May 2013 20:54:17 +0200, s.day <s.d### [at] uelacuk> wrote:

> Thanks, just what I needed.
>
>
You're welcome :)

-- 
-Nekar Xenos-


Post a reply to this message

From: Christian Froeschlin
Subject: Re: access object attributes
Date: 15 May 2013 17:45:40
Message: <51940204$1@news.povray.org>
Nekar Xenos wrote:

> ObjectCenter = min_extent(Object)+.5*(max_extent(Object)-minExtent(Object))

Or 0.5*(min + max) if you're a fan of distributive law ;)

Also note that min/max_extend is actually the bounding
box and may not yield the expected position for all objects.


Post a reply to this message

From: Nekar Xenos
Subject: Re: access object attributes
Date: 15 May 2013 23:42:25
Message: <op.ww5q8yd1ufxv4h@xena>
On Wed, 15 May 2013 23:46:07 +0200, Christian Froeschlin <chr### [at] chrfrde>  
wrote:

> Nekar Xenos wrote:
>
>> ObjectCenter =  
>> min_extent(Object)+.5*(max_extent(Object)-minExtent(Object))
>
> Or 0.5*(min + max) if you're a fan of distributive law ;)
>
> Also note that min/max_extend is actually the bounding
> box and may not yield the expected position for all objects.
>

It seems it's too long since I've done proper algebra. Your solution makes  
perfect sense, yet can't seem to get from my solution to yours  
algebraically.

-- 
-Nekar Xenos-


Post a reply to this message

From: Christian Froeschlin
Subject: Re: access object attributes
Date: 16 May 2013 16:55:08
Message: <519547ac$1@news.povray.org>
>>> min_extent(Object)+.5*(max_extent(Object)-minExtent(Object))
>>
>> Or 0.5*(min + max) if you're a fan of distributive law ;)
> 
> It seems it's too long since I've done proper algebra. Your solution 
> makes perfect sense, yet can't seem to get from my solution to yours 
> algebraically.

an algebraic mystification that is easily resolved ;)

   1.0 * min + 0.5 * (max - min)
= 1.0 * min + 0.5 * max - 0.5 * min
= 0.5 * min + 0.5 * max
= 0.5 * (min + max)


Post a reply to this message

From: Stephen
Subject: Re: access object attributes
Date: 16 May 2013 17:17:42
Message: <51954cf6$1@news.povray.org>
On 16/05/2013 9:55 PM, Christian Froeschlin wrote:
> an algebraic mystification that is easily resolved ;)
>
>    1.0 * min + 0.5 * (max - min)
> = 1.0 * min + 0.5 * max - 0.5 * min
> = 0.5 * min + 0.5 * max
> = 0.5 * (min + max)

You are right of course.
But why put that "1.0 + " on the first line?

I think of it (the first line), from my mid 20th Cent schooling, as:
Half of the difference between max and min plus the "offset" of min.


-- 
Regards
     Stephen


Post a reply to this message

From: Nekar Xenos
Subject: Re: access object attributes
Date: 16 May 2013 23:23:28
Message: <op.ww7k1codufxv4h@xena>
On Thu, 16 May 2013 22:55:38 +0200, Christian Froeschlin <chr### [at] chrfrde>  
wrote:

>>>> min_extent(Object)+.5*(max_extent(Object)-minExtent(Object))
>>>
>>> Or 0.5*(min + max) if you're a fan of distributive law ;)
>>  It seems it's too long since I've done proper algebra. Your solution  
>> makes perfect sense, yet can't seem to get from my solution to yours  
>> algebraically.
>
> an algebraic mystification that is easily resolved ;)
>
>    1.0 * min + 0.5 * (max - min)
> = 1.0 * min + 0.5 * max - 0.5 * min
> = 0.5 * min + 0.5 * max
> = 0.5 * (min + max)

Of course. It helps to write it down and not just try and solve it in my  
mind ;)

-- 
-Nekar Xenos-


Post a reply to this message

From: Nekar Xenos
Subject: Re: access object attributes
Date: 16 May 2013 23:24:15
Message: <op.ww7k2oraufxv4h@xena>
On Thu, 16 May 2013 23:17:42 +0200, Stephen <mca### [at] aolcom> wrote:

> On 16/05/2013 9:55 PM, Christian Froeschlin wrote:
>> an algebraic mystification that is easily resolved ;)
>>
>>    1.0 * min + 0.5 * (max - min)
>> = 1.0 * min + 0.5 * max - 0.5 * min
>> = 0.5 * min + 0.5 * max
>> = 0.5 * (min + max)
>
> You are right of course.
> But why put that "1.0 + " on the first line?
>
> I think of it (the first line), from my mid 20th Cent schooling, as:
> Half of the difference between max and min plus the "offset" of min.
>
It did help to clarify the issue though.

-- 
-Nekar Xenos-


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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