POV-Ray : Newsgroups : povray.general : object oriented features Server Time
26 Nov 2026 21:57:14 EST (-0500)
  object oriented features (Message 23 to 62 of 62)  
<<< Previous 22 Messages Goto Initial 50 Messages
From: ingo
Subject: Re: object oriented features
Date: 20 Aug 2000 05:31:33
Message: <8F967E954seed7@204.213.191.228>
Mikael Carneholm wrote:

>Abe Heckenbach wrote:
>
>>    6. why not give each object, including group objects, and cameras
>>    a 
>> name, so it can be easily referenced later(so it can be removed,
>> moved, scaled, change properties like color...(animator's might like
>> this;>) 
>
>This is in the direction of OO-features in the scene language - a
>popular(?) topic in these groups.

This might be interesting:
http://virtualphoton.pc.cc.cmu.edu/projects/visual/
http://cil.andrew.cmu.edu/projects/visual/vpythonprog.htm

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Peter J  Holzer
Subject: Re: object oriented features
Date: 20 Aug 2000 10:01:37
Message: <slrn8pvku6.ljo.hjp-usenet@teal.h.hjp.at>
On 19 Aug 2000 20:38:33 -0400, Warp wrote:
>In povray.general Mikael Carneholm <sa9### [at] idautbhbse> wrote:
>: Location, as I thought of it, should be one of the common attributes for all
>: objects. Think java again:
>
>: public virtual class POVOBJECT{
>:   public povVector location, rotation;
>: }
>
>  Now you forget one thing: That takes memory. And povray is not very well
>known when speaking about low memory consumption. Let's not make the matter
>even worse.

Then think:

public virtual class POVOBJECT{
  public povVector getLocation(), getRotation();
}

That doesn't take extra memory per object and is also cleaner from
an OO point of view. The methods could compute their values from the
transformation matrix for most objects.

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

From: Warp
Subject: Re: object oriented features
Date: 20 Aug 2000 10:48:21
Message: <399fefb4@news.povray.org>
In povray.general Peter J. Holzer <hjp### [at] sikituwsracat> wrote:
: That doesn't take extra memory per object and is also cleaner from
: an OO point of view. The methods could compute their values from the
: transformation matrix for most objects.

  How do you compute the location, scale and rotation of an object from its
transformation matrix?
  AFAIK there's more than one way to get any specific transformation matrix.

  The problem becomes clearer when you think about sheared objects.

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


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 20 Aug 2000 12:02:00
Message: <chrishuff-253D06.11031920082000@news.povray.org>
In article <399D6B3D.51EACD7E@ida.utb.hb.se>, sa9### [at] idautbhbse 
wrote:

> Location, as I thought of it, should be one of the common attributes 
> for all objects.
...snip...

Still, what *is* the location? A sphere has a center, but what is the 
center of a cone? The middle of the bounding box? The center of gravity?
What is the "location" of an infinite plane? A complex mesh or CSG?
Each object should have it's own variables available, but a single 
"location" variable for all of them isn't possible. Maybe a 
GetLocation() method for all objects in the finite object portion of the 
heirarchy, but you still have to define the location of an arbitrary 
object.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 20 Aug 2000 12:06:59
Message: <chrishuff-0C91D4.11081820082000@news.povray.org>
In article <slr### [at] tealhhjpat>, 
hjp### [at] SiKituwsracat (Peter J. Holzer) wrote:

> That doesn't take extra memory per object and is also cleaner from
> an OO point of view. The methods could compute their values from the
> transformation matrix for most objects.

Warp is right, matrices store many transforms in order, and there are 
usually a very large or infinite number of possible 
rotations/translations/scales to get to a specific point.
And what would the "object rotation" mean? The direction of the z axis 
in degrees? I think you are thinking of the sum of all rotations, which 
I don't think you can easily extract from a matrix which also stores 
translations, scaling, and arbitrary matrix transforms. Just make the 
matrix available, the user can override the rotate() methods to save 
each rotation in a vector if they want.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Ron Parker
Subject: Re: object oriented features
Date: 20 Aug 2000 23:54:19
Message: <slrn8q1amj.oo.ron.parker@fwi.com>
On Fri, 18 Aug 2000 11:15:57 +0200, Mikael Carneholm wrote:
>Warp wrote:
>
>>   What would be the advantage of transforming subobjects after the CSG has
>> been declared?
>>
>
>I think the main advantage of OO (from my point of view) would be _reading_
>the location/rotation/scale etc. of objects, instead of (as in the example):
>setting the values. 

I don't understand this mindset.  If you need to know what transformations
have been applied to object foo at some point in the future, keep track of
what transformations you've applied.  What's so hard about that?

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Ron Parker
Subject: Re: object oriented features
Date: 20 Aug 2000 23:59:36
Message: <slrn8q1b0g.oo.ron.parker@fwi.com>
On Sun, 20 Aug 2000 11:08:18 -0500, Chris Huff wrote:
>I don't think you can easily extract from a matrix which also stores 
>translations, scaling, and arbitrary matrix transforms. Just make the 
>matrix available, the user can override the rotate() methods to save 
>each rotation in a vector if they want.

You might be surprised.  Except for the arbitrary transforms (which make
the problem different, but possibly not much more difficult) it's relatively 
easy to decompose a matrix into rotations, scales, and translates.  I wrote
the whole mess up for someone in c.g.r.r. a few years ago; I think I might
still have it in my outbox.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Warp
Subject: Re: object oriented features
Date: 21 Aug 2000 05:28:18
Message: <39a0f632@news.povray.org>
In povray.general Ron Parker <ron### [at] povrayorg> wrote:
: You might be surprised.  Except for the arbitrary transforms (which make
: the problem different, but possibly not much more difficult) it's relatively 
: easy to decompose a matrix into rotations, scales, and translates.  I wrote
: the whole mess up for someone in c.g.r.r. a few years ago; I think I might
: still have it in my outbox.

  How do you decompose a matrix transformation which causes shearing to
rotations, scales and translates?
  For example think about this:

scale <1,.5,.8>
rotate <30,45,20>
scale <.8,.25,.5>
translate <2,3,4>
rotate <15,20,80>

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


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 08:04:39
Message: <39A11AD5.5A347EF4@ida.utb.hb.se>
Chris Huff wrote:

> Still, what *is* the location? A sphere has a center, but what is the
> center of a cone? The middle of the bounding box? The center of gravity?
> What is the "location" of an infinite plane? A complex mesh or CSG?
> Each object should have it's own variables available, but a single
> "location" variable for all of them isn't possible. Maybe a
> GetLocation() method for all objects in the finite object portion of the
> heirarchy, but you still have to define the location of an arbitrary
> object.
>

I apologize if I was unclear about this. Your previous post made me realize
that it's better to have object type specific attributes (like .origin for
sphere, .top & .bottom for cylinder, .corner1 & .corner2 for box, .normal
and .distance for plane, etc.)  which relate to the initial values given
when the object was created, and then separate .translation and .rotation
attributes (alt. getTranslation() & getRotation() methods). Collecting
information about an objects whereabouts should then be no problem - if the
.translation and .rotation attributes correspond to the respective values in
the transformation matrix of the object. Again, an example:

#declare ABox = box{
  <-1,-1,-1>,
  <1,1,1>
  translate <5,1,0>
}

Then:

ABox.corner1 = <-1,-1,-1>
ABox.corner2 = <1,1,1>
ABox.translation = <5,1,0>

...which means the exact position of "corner1" can be retrieved by

#declare corner1_pos = ABox.corner1 + ABox.translation;

I think this makes more sense, as an object always is created with some
parameters, and then translated/rotated various amounts. It should thus be
quite logical to collect info about an object my reversing the creation
process; think of it as setting the values at creation and getting the same
values at a later point.

Btw, check the VPython pages that ingo found:

http://virtualphoton.pc.cc.cmu.edu/projects/visual/
http://cil.andrew.cmu.edu/projects/visual/vpythonprog.htm

Not very far from POV-Script actually - except that it is object oriented,
of course.

----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: Tom Melly
Subject: Re: object oriented features
Date: 21 Aug 2000 08:42:00
Message: <39a12398$1@news.povray.org>
"Mikael Carneholm" <sa9### [at] idautbhbse> wrote in message
news:39A11AD5.5A347EF4@ida.utb.hb.se...

> I apologize if I was unclear about this. Your previous post made me
realize
> that it's better to have object type specific attributes (like .origin for
> sphere, .top & .bottom for cylinder, .corner1 & .corner2 for box, .normal
> and .distance for plane, etc.)  which relate to the initial values given
> when the object was created, and then separate .translation and .rotation
> attributes (alt. getTranslation() & getRotation() methods). Collecting
> information about an objects whereabouts should then be no problem - if
the
> .translation and .rotation attributes correspond to the respective values
in
> the transformation matrix of the object. Again, an example:
>
> #declare ABox = box{
>   <-1,-1,-1>,
>   <1,1,1>
>   translate <5,1,0>
> }
>
> Then:
>
> ABox.corner1 = <-1,-1,-1>
> ABox.corner2 = <1,1,1>
> ABox.translation = <5,1,0>
>
> ...which means the exact position of "corner1" can be retrieved by
>
> #declare corner1_pos = ABox.corner1 + ABox.translation;
>
> I think this makes more sense, as an object always is created with some
> parameters, and then translated/rotated various amounts. It should thus be
> quite logical to collect info about an object my reversing the creation
> process; think of it as setting the values at creation and getting the
same
> values at a later point.
>

Such an approach might work for simple primitives, but would fail on
anything more complex - how do you define a sensible reference point for a
blob? In addition, this is forcing a model onto POV that POV does not
actually use. Even if it was only implemented on simple primitives, it would
potentially lead new users astray.

Besides, your code could be rewritten as (I think):

#declare ABoxC1 = <-1,-1,-1>;
#declare ABoxC2 = <1,1,1>;
#declare ABoxTran = <5,1,0>;

#declare ABox = box{ ABoxC1, ABoxC2 translate ABoxTran }

#declare corner1_pos = ABoxC1 + ABoxTran;


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 08:42:11
Message: <39A123A1.5B90BD85@ida.utb.hb.se>
Ron Parker wrote:

> I don't understand this mindset.  If you need to know what transformations
> have been applied to object foo at some point in the future, keep track of
> what transformations you've applied.  What's so hard about that?

The main issue is the extremely hard extra work load ;-)

Well, there are situations when it just should be very convenient to be able to
collect info about an object by accessing the attributes of it. An example is in
a situation when you're writing an include file, and you want to access the
objects in the users file, without having to force the user to declare separate
values for camera locations, light source transformations etc. It's just a
question of simplicity and convenience.

An example - compare this:

camera{ location <0,1,-10>  look_at 0 }
#declare foo = light_source{ <50,50,-100> color rgb 1 }

...to this:

#declare camera_lookat = <0,1,-10>;
#declare object_position = <50,50,-100>;
camera{ location <0,1,-10>  look_at camera_lookat }
#declare foo = light_source{ object_position color rgb 1 }

Much less work needed to retrieve the look_at of the camera and the location of
foo using camera.look_at and foo.origin later in the file as provided in the fist
case, don't you agree? Much less work needed by the user, i.e....more user
friendly, to use a popular phrase... :)

Making POV-Ray (even) more user friendly at the same time as you're providing a
more powerful scripting language can't really be a bad thing, can it?

----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: object oriented features
Date: 21 Aug 2000 09:00:09
Message: <39a127d9$1@news.povray.org>
In article <39A123A1.5B90BD85@ida.utb.hb.se> , Mikael Carneholm 
<sa9### [at] idautbhbse>  wrote:

> Making POV-Ray (even) more user friendly at the same time as you're providing
> a more powerful scripting language can't really be a bad thing, can it?

Just wondering, what do you think is faster:

- Selecting a menu item in a menu (the menu bar is at the top of the screen)
- Using a keyboard shortcut


    Thorsten


Post a reply to this message

From: Ron Parker
Subject: Re: object oriented features
Date: 21 Aug 2000 09:47:51
Message: <slrn8q2dfn.11q.ron.parker@fwi.com>
On 21 Aug 2000 05:28:18 -0400, Warp wrote:
>In povray.general Ron Parker <ron### [at] povrayorg> wrote:
>: You might be surprised.  Except for the arbitrary transforms (which make
>: the problem different, but possibly not much more difficult) it's relatively 
>: easy to decompose a matrix into rotations, scales, and translates.  I wrote
>: the whole mess up for someone in c.g.r.r. a few years ago; I think I might
>: still have it in my outbox.
>
>  How do you decompose a matrix transformation which causes shearing to
>rotations, scales and translates?
>  For example think about this:
>
>scale <1,.5,.8>
>rotate <30,45,20>
>scale <.8,.25,.5>
>translate <2,3,4>
>rotate <15,20,80>

It's been a while.  I think there were additional constraints on the solution.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 09:58:32
Message: <39A13586.CD67AD69@ida.utb.hb.se>
Thorsten Froehlich wrote:

> Just wondering, what do you think is faster:
>
> - Selecting a menu item in a menu (the menu bar is at the top of the screen)
> - Using a keyboard shortcut

This is not comp.os.microsoft.windows.forgetting.keyboard.interaction - please post
to the proper group.

----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: object oriented features
Date: 21 Aug 2000 10:07:21
Message: <39a13799@news.povray.org>
In article <39A13586.CD67AD69@ida.utb.hb.se> , Mikael Carneholm 
<sa9### [at] idautbhbse>  wrote:

>> Just wondering, what do you think is faster:
>>
>> - Selecting a menu item in a menu (the menu bar is at the top of the screen)
>> - Using a keyboard shortcut
>
> This is not comp.os.microsoft.windows.forgetting.keyboard.interaction - please
> post to the proper group.

:-)   I am still curious what you think is faster ... I won't start a flame
war for either answer, just would like to know.


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 10:44:37
Message: <39A14052.36F8CD0F@ida.utb.hb.se>
Tom Melly wrote:

> Such an approach might work for simple primitives, but would fail on
> anything more complex - how do you define a sensible reference point for a
> blob?

I don't think anything is impossible - until proven, of course. My suggestion
for blob as well as CSG objects or other complex objects is the use of a
.subobject[] property, along with a .subobject_count. An example:

#declare ABlob = blob {
    threshold .65
    sphere { <.5,0,0>, .8, 1 pigment {Blue} }
    sphere { <-.5,0,0>,.8, 1 pigment {Pink} }
    finish { phong 1 }
  }

The blob object lends itself nicely to OO, like this:

ABlob
    -subobject_count
    -subobject[0]
        -type //sphere or cylinder
        -origin  // as it is a sphere
        -radius
        -strength
        -pigment
    -subobject[1]
        ..
    -finish

(If some of the blob items had been a cylinder, there had been .top and .bottom
properties of subobject[0] instead of .origin.)

This means we can access our blob as in this example:

#declare i=0;
#while(i<ABlob.subobject_count - 1)
    #if(ABlob.subobject[i].type=0)    // type 0 = sphere, 1 = cylinder
        // do something using subobject[i].origin
    #else
        // do something using subobject[i].top, subobject[i].bottom
    #end
    #declare ABlob.subobject[i].radius = ABlob.subobject[i].radius + 1;
    #declare ABlob.subobject[i].strength = ABlob.subobject[i].strength + i / 10;

    #declare i=i+1;
#end

A CSG example:

#declare ACSG = difference{
    box{1,-1}
    difference{
        sphere{0, 1}
        plane{y, 0}
        translate <1,0,0>
    }
}

ACSG
    -subobject_count
    -subobject[0]    //the box
    -subobject[1]    //the sphere - plane difference
        -subobject_count
        -subobject[0]    // the sphere
        -subobject[1]    // the plane

We could now access the plane down in the hierarchy by

ACSG.subobject[1].subobject[1]

Similar for meshes, unions of bicubic patches, etc.

----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: Tom Melly
Subject: Re: object oriented features
Date: 21 Aug 2000 11:26:29
Message: <39a14a25@news.povray.org>
"Mikael Carneholm" <sa9### [at] idautbhbse> wrote in message
news:39A14052.36F8CD0F@ida.utb.hb.se...
> Tom Melly wrote:
>
> > Such an approach might work for simple primitives, but would fail on
> > anything more complex - how do you define a sensible reference point for
a
> > blob?
>
> I don't think anything is impossible - until proven, of course. My
suggestion
> for blob as well as CSG objects or other complex objects is the use of a
> .subobject[] property, along with a .subobject_count. An example:
>

<snip>

Hmm, well, yes... So blobs would need seperate syntax to handle
spherical/cylindrical components, and you still don't have an origin for the
blob as a whole. I guess I might be more positive if I understood how you
thought this would help POV. I don't do much pov-animation - is that where
you would see it as more useful? Still, while playing this game, I would
have thought that if one was going to settle for an arbitary "origin" for
all objects, the best point would be the first vector specified for the
object. So, for a blob, it would be the first point of the first component,
whether cylindrical or spherical.

BTW, and I've only played with this in my head, but I'm wondering if one
could take a perl-like approach to OOP in POV and bolt OOP on with some
well-written include files ( a bit unfair on perl, but you know what I
mean... probably). Hmm, the more I think about it, the more possible it
sounds. Probably falls into the catagory of "interesting but stupid", but
might be fun to play with.


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 21 Aug 2000 11:30:31
Message: <chrishuff-0A9549.10314921082000@news.povray.org>
In article <slr### [at] fwicom>, ron### [at] povrayorg 
wrote:

> You might be surprised.  Except for the arbitrary transforms (which 
> make the problem different, but possibly not much more difficult) 
> it's relatively easy to decompose a matrix into rotations, scales, 
> and translates.  I wrote the whole mess up for someone in c.g.r.r. a 
> few years ago; I think I might still have it in my outbox.

But can you decompose the matrix into the *same* set of transforms which 
produced it?
My understanding is that there are often an infinite number of 
solutions. Getting the "orientation" might be useful, but what else 
would be possible?

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 21 Aug 2000 11:36:08
Message: <chrishuff-5467DF.10372821082000@news.povray.org>
In article <39a127d9$1@news.povray.org>, "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> Just wondering, what do you think is faster:
> 
> - Selecting a menu item in a menu (the menu bar is at the top of the 
> screen)
> - Using a keyboard shortcut

Keyboard shortcut(assuming you already know the shortcuts). Otherwise, 
you have to use the menu(or keep the manual open).

Writing a particle system or other complex coding in POV-Script versus 
OOPov-Script: OOPOV-Script.

Learning the basics of using the above: neither.(the basics are exactly 
the same)

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 12:18:00
Message: <39A15634.5AA90EA2@ida.utb.hb.se>
Tom Melly wrote:

> Hmm, well, yes... So blobs would need seperate syntax to handle
> spherical/cylindrical components, and you still don't have an origin for the
> blob as a whole.

Well, since blobs are made of the objects it consists of,  shouldn't one be able
to access the whole by accessing it's parts?

A little abstract maybe, but look at this:

3A={
    A1
    A2
    A3
}

If you remove A1, A2 and A3, then what's left of 3A? All 3A is is completely
defined by it's parts A1, A2 and A3, i.e

3A = A1+A2+A3.

Thus, to do something to 3A, you can just as well do something to it's parts A1,
A2 & A3, since they define 3A!

If you say a blob should have an origin, how do you define the origin - since
the object itself does not is nothing but a function between it's primitive
parts? It's primitive parts have origins though, so if it's the position of the
blob you're after you can use the positions of it's parts!


> I guess I might be more positive if I understood how you
> thought this would help POV. I don't do much pov-animation - is that where
> you would see it as more useful?

That's a good example of where it could come in handy, yes.

> Still, while playing this game, I would
> have thought that if one was going to settle for an arbitary "origin" for
> all objects, the best point would be the first vector specified for the
> object.

A common "location", "position", "origin" or whatever you want to call it is not
worth discussing. How do you define the location of a mesh or a union of
disjoint primitives? Accessing the values used to construct the objects together
with the objects .translation and .rotation vectors is a much better idea, and
you can probably achieve the same results that way.

> BTW, and I've only played with this in my head, but I'm wondering if one
> could take a perl-like approach to OOP in POV and bolt OOP on with some
> well-written include files ( a bit unfair on perl, but you know what I
> mean... probably).

As the current language is as good as any language can be at describing
primitives, I don't see any reason for changing that. Added OO is all that's
needed, so let's keep the other parts as it is.

> Hmm, the more I think about it, the more possible it
> sounds. Probably falls into the catagory of "interesting but stupid", but
> might be fun to play with.

Since when is something that's useful stupid?

----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 12:24:23
Message: <39A157B4.CB02BDDC@ida.utb.hb.se>
Chris Huff wrote:

> Writing a particle system or other complex coding in POV-Script versus
> OOPov-Script: OOPOV-Script.
>
> Learning the basics of using the above: neither.(the basics are exactly
> the same)
>

I think I'm in love.

;-)

----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 21 Aug 2000 12:25:37
Message: <chrishuff-FC4765.11265721082000@news.povray.org>
In article <39A11AD5.5A347EF4@ida.utb.hb.se>, sa9### [at] idautbhbse 
wrote:

> I think this makes more sense, as an object always is created with 
> some parameters, and then translated/rotated various amounts. It 
> should thus be quite logical to collect info about an object my 
> reversing the creation process; think of it as setting the values at 
> creation and getting the same values at a later point.

You left out "matrix" and "scale" transforms.
What do you propose? Saving a certain group of points, so the 
orientation of the object could be obtained? Say, origin(which would be 
<0,0,0>), x, y, and z, which would be transformed with the object and 
retrievable later? This seems inefficient, why not just make the 
transform available, and transform vectors yourself?
Or do you want to add rotations and translations to member variables, so 
you can have the total rotation and translation applied to the object? 
How useful would this be?

I think you can do all you need by simply making the transformation 
matrix available to the user. If the user needs more, they can create a 
new object and override the rotate(), translate(), etc. methods 
themselves to do what they want.


> Btw, check the VPython pages that ingo found:
> 
> http://virtualphoton.pc.cc.cmu.edu/projects/visual/
> http://cil.andrew.cmu.edu/projects/visual/vpythonprog.htm
> 
> Not very far from POV-Script actually - except that it is object 
> oriented, of course.

This does look kind of interesting...especially this part: "We hope to 
have a Macintosh version by August 2000." :-)
However, it looks like it would be a pretty big adjustment from 
POV-Script. And it would need a bit of adjustment to fit with POV...it 
seems designed to do dynamic realtime animations, while POV does frames. 
And it looks like all objects are drawn, no matter what, I would prefer 
at least a draw() method so I can have objects which aren't drawn.
But it looks nice and efficient, just 12 lines...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 12:28:41
Message: <39A158B5.89881F5A@ida.utb.hb.se>
Thorsten Froehlich wrote:

> :-)   I am still curious what you think is faster ... I won't start a flame
> war for either answer, just would like to know.
>

Since my hands are resting on the keyboard and I only use the mouse when surfing or
when modelling in some 3d program, my answer is of course: the keyboard. Another way
to answer that question: I only use the mouse when I have to. :)

----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: Mikael Carneholm
Subject: Re: object oriented features
Date: 21 Aug 2000 12:53:36
Message: <39A15E8D.91B2E3E7@ida.utb.hb.se>
Chris Huff wrote:

> You left out "matrix" and "scale" transforms.

I know...for simplicity I only mentioned translation and rotation.

> I think you can do all you need by simply making the transformation
> matrix available to the user. If the user needs more, they can create a
> new object and override the rotate(), translate(), etc. methods
> themselves to do what they want.

This is probably exactly what I'm looking for. That is, if the values used
to create the object are available also (like the first vector in the sphere
expression, the float value determining the radius, etc.). Note that
"origin" only applies to that first vector parameter in spheres and light
sources...(from what I currently can recall) - other objects use other
construction parameters, like the box with it's two vectors that probably
best could be called .corner1 & .corner2, or something like that. All that
should be object specific, as said before.

> However, it looks like it would be a pretty big adjustment from
> POV-Script. And it would need a bit of adjustment to fit with POV...it
> seems designed to do dynamic realtime animations, while POV does frames.
> And it looks like all objects are drawn, no matter what, I would prefer
> at least a draw() method so I can have objects which aren't drawn.
> But it looks nice and efficient, just 12 lines...
>

I don't want VPython to be the new OO POV-Script - but VPython could be seen
as an example of how nice and efficient it should be...nothing else.


----------------------------------------------------
Mikael Carneholm, B.Sc.
Dep. of Computer Science and Business Administration
UCB (University College of Borås) Sweden

Personal homepage:
http://www.studenter.hb.se/~arch
E-mail:
sa9### [at] idautbhbse


Post a reply to this message

From: John VanSickle
Subject: Re: object oriented features
Date: 22 Aug 2000 09:10:43
Message: <39A27BD2.C662EFED@erols.com>
Ron Parker wrote:
> 
> On 21 Aug 2000 05:28:18 -0400, Warp wrote:
> >In povray.general Ron Parker <ron### [at] povrayorg> wrote:
> >: You might be surprised.  Except for the arbitrary transforms (which make
> >: the problem different, but possibly not much more difficult) it's relatively
> >: easy to decompose a matrix into rotations, scales, and translates.  I wrote
> >: the whole mess up for someone in c.g.r.r. a few years ago; I think I might
> >: still have it in my outbox.
> >
> >  How do you decompose a matrix transformation which causes shearing to
> >rotations, scales and translates?
> >  For example think about this:
> >
> >scale <1,.5,.8>
> >rotate <30,45,20>
> >scale <.8,.25,.5>
> >translate <2,3,4>
> >rotate <15,20,80>
> 
> It's been a while.  I think there were additional constraints on the solution.

Most algorithms to decompose matrices begin by assuming that the component
transforms were done in a particular order.  This generally works because the
predominant habit among modellers is to scale first, rotate second, and translate
third.  The resulting matrix can always be broken down into the original three
transforms (with a caveat in regards to rotation).

Note that the translate could have been the second or even the first
transform actually applied; however, simple examination of the resulting
matrix cannot reveal whether this is so.

Likewise, if shearing is present, there is no way to tell when or how it was
done.  Consequently the decomposing algorithm must make assumptions, which
may be wrong.

The only time one can make a useful guess at the order of operations is when
the matrix under consideration is a slight modification of a matrix whose
original transforms are already known.  Evn then it can be tricky.

Regards,
John


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 22 Aug 2000 11:20:27
Message: <chrishuff-71371A.10214922082000@news.povray.org>
In article <39A27BD2.C662EFED@erols.com>, John VanSickle 
<van### [at] erolscom> wrote:

> Most algorithms to decompose matrices begin by assuming that the 
> component transforms were done in a particular order.  This generally 
> works because the predominant habit among modellers is to scale 
> first, rotate second, and translate third.  The resulting matrix can 
> always be broken down into the original three transforms (with a 
> caveat in regards to rotation).

Ouch, I often rotate after translating or alternate rotation and 
scaling...I don't think this would work well. And how does it deal with 
things like rotations around an arbitrary axis? (which is a transform I 
have considered adding)
This does seem too unreliable, and the user could always override the 
macros to do what they want, like saving the transforms as they are 
applied.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Ron Parker
Subject: Re: object oriented features
Date: 22 Aug 2000 12:40:49
Message: <slrn8q5c0n.1bm.ron.parker@fwi.com>
On Tue, 22 Aug 2000 10:21:49 -0500, Chris Huff wrote:
>Ouch, I often rotate after translating or alternate rotation and 
>scaling...I don't think this would work well. And how does it deal with 
>things like rotations around an arbitrary axis? (which is a transform I 
>have considered adding)

Provided that no skewing took place (that is, that you get three orthogonal 
vectors when you transform three orthogonal vectors) it deals quite well.
It just doesn't give you the results you may have expected.  

For example, 

translate x rotate 45*y 

is equivalent to 

rotate 45*y translate <sqrt(.5),0,-sqrt(.5)>

Similarly, 

rotate 45*y around_point x // if such a syntax existed

would be equivalent to

rotate 45*y translate <1-sqrt(.5),0,sqrt(.5)>

BTW, the transform you mentioned would probably be better implemented as 
a macro, but I think it's been done.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 22 Aug 2000 13:09:47
Message: <chrishuff-08B6D3.12111122082000@news.povray.org>
In article <slr### [at] fwicom>, ron### [at] povrayorg 
wrote:

> BTW, the transform you mentioned would probably be better implemented as 
> a macro, but I think it's been done.

It has been done as a macro. There are three transforms I am 
considering: 

axis_rotate AMOUNT, AXIS  Rotates around a specified axis.

directional_scale AMOUNT, DIRECTION  Scales in a certain direction(like 
in the LiquidSpray include and the particle_stretch feature in my 
particle_system patch).

coordinate_system X, Y, Z  Takes three vectors for the new directions of 
each axis. This would make operations like shearing a lot easier.

These could all be done with macros, but might be nice if available 
built-in. Rotate, scale, and translate could also be done as macros(and 
maybe they would have been if macros had existed at the beginning), all 
that is really necessary is the matrix transform.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: John VanSickle
Subject: Re: object oriented features
Date: 22 Aug 2000 18:05:29
Message: <39A2F9B6.8292AE67@erols.com>
Chris Huff wrote:
> 
> In article <slr### [at] fwicom>, ron### [at] povrayorg
> wrote:
> 
> > BTW, the transform you mentioned would probably be better implemented as
> > a macro, but I think it's been done.
> 
> It has been done as a macro. There are three transforms I am
> considering:
> 
> axis_rotate AMOUNT, AXIS  Rotates around a specified axis.

AKA the AxisRotate() macro in the Thoroughly Useful Macros;

> directional_scale AMOUNT, DIRECTION  Scales in a certain direction(like
> in the LiquidSpray include and the particle_stretch feature in my
> particle_system patch).

AKA the Stretch() macro in the Throughly Useful Macros;

> coordinate_system X, Y, Z  Takes three vectors for the new directions of
> each axis. This would make operations like shearing a lot easier.

AKA the Matrix() macro in the Thoroughly Useful Macros.

> These could all be done with macros, but might be nice if available
> built-in. Rotate, scale, and translate could also be done as macros(and
> maybe they would have been if macros had existed at the beginning), all
> that is really necessary is the matrix transform.

Quite true.

However, the current situation (a few language features, plus a few
augmenting macros) seems to be getting everyone's scenes together.
Adding the above features will make things parse slightly faster, but
will have zero impact on rendering speed (because internally everything
is boiled down to one matrix).

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Nathan Kopp
Subject: Re: object oriented features
Date: 22 Aug 2000 18:31:32
Message: <39a2ff44@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote...
>
> - Selecting a menu item in a menu (the menu bar is at the top of the
screen)
> - Using a keyboard shortcut
>

This is very interesting.  Many GUI OS and application designers have chosen
to provide both.  The keyboard shortcuts, which have a higher learning
curve, are presented in such a way that experts love them, but newbies
ignore them.  Mouse-operated features are used by newbies and experts alike.

In other words, the introduction of a new method of doing something, if
presented properly, will not necessarily confuse newbies, but will provided
added functionality that experts will grow to love, once they have mastered
the slightly steeper learning curve.

-Nathan


Post a reply to this message

From: Warp
Subject: Re: object oriented features
Date: 23 Aug 2000 06:40:20
Message: <39a3aa14@news.povray.org>
In povray.general Nathan Kopp <Nat### [at] koppcom> wrote:
: In other words, the introduction of a new method of doing something, if
: presented properly, will not necessarily confuse newbies, but will provided
: added functionality that experts will grow to love, once they have mastered
: the slightly steeper learning curve.

  This fact seems to be hard to understand to many people who aggressively
fight against new features. Their argument is almost always the same: "It
will be too hard for newusers to learn". They always forget (or they just
ignore) the fact you mentioned above.

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


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: object oriented features
Date: 23 Aug 2000 09:55:02
Message: <39a3d7b6@news.povray.org>
In article <39a2ff44@news.povray.org> , "Nathan Kopp" <Nat### [at] Koppcom> 
wrote:

> This is very interesting.  Many GUI OS and application designers have chosen
> to provide both.  The keyboard shortcuts, which have a higher learning
> curve, are presented in such a way that experts love them, but newbies
> ignore them.  Mouse-operated features are used by newbies and experts alike.

This was not the reason for my question * :-)


     Thorsten


* Either you dig for the various research papers regarding this topic, or
you try to locate a copy of

Tog on Interface
by Bruce Tognazzini
Addison-Wesley 1992
ISBN 0-201-60842-1

in your local libraries.  It explains in a funny way what Apple did with $50
million of research money to create the Lisa and Mac user interface.  Some
of the results are really surprising and unexpected...


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 23 Aug 2000 10:13:53
Message: <chrishuff-1182CE.09151623082000@news.povray.org>
In article <39A2F9B6.8292AE67@erols.com>, John VanSickle 
<van### [at] erolscom> wrote:

> AKA the AxisRotate() macro in the Thoroughly Useful Macros;

Correct...


> AKA the Stretch() macro in the Throughly Useful Macros;

Didn't know about this one, I salvaged the code from the Liquid Spray 
include when I needed it...


> AKA the Matrix() macro in the Thoroughly Useful Macros.

Correct. Maybe a call it "matrix2"?


> However, the current situation (a few language features, plus a few
> augmenting macros) seems to be getting everyone's scenes together.

Yes...but unless these macros are included with the standard includes, 
people have to copy them into their scene files, which wastes space and 
is not as clear as a new transform would be. Also, think of the use of 
scale, rotate, etc. in little code snippets...missing macros have caused 
people trouble already. And these transforms seem pretty basic...as 
basic as scale, translate, and rotate, at least, and there is already a 
vector function for the axis-rotation...
At the least, I am going to add functions to the source to do these 
transforms(the ones not already implemented, that is)...I have found 
some of them useful in my patches.


> Adding the above features will make things parse slightly faster,

Probably not even enough to notice unless you have a loop that does them 
thousands of times.


> but will have zero impact on rendering speed (because internally 
> everything is boiled down to one matrix).

Yep.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: object oriented features
Date: 23 Aug 2000 11:10:48
Message: <39a3e978@news.povray.org>
In article <39a3d7b6@news.povray.org> , "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> * Either you dig for the various research papers regarding this topic, or
> you try to locate a copy of
>
> Tog on Interface
> by Bruce Tognazzini
> Addison-Wesley 1992
> ISBN 0-201-60842-1
>
> in your local libraries.  It explains in a funny way what Apple did with $50
> million of research money to create the Lisa and Mac user interface.  Some
> of the results are really surprising and unexpected...

Maybe this document is easier to get:

Walker, Neff and Smelcer, John (1990):
"A Comparison of Selection Time from Walking and Bar Menus."
Proceedings of CHI¹90, Addison-Wesley, Reading, Mass., pp. 221-225.


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Andrea Ryan
Subject: Re: object oriented features
Date: 24 Aug 2000 21:41:07
Message: <39A5CB9A.13BC7C66@global2000.net>
> This would look like Smalltalk where you can create objects only by
> inherting it from a preexisting class hierarchy.  But this is only
> readsay.

Brendan

> arrange all objects in a heirarchy, with "object" being the base object


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 25 Aug 2000 11:04:55
Message: <chrishuff-EAE43F.10062225082000@news.povray.org>
In article <39A5CB9A.13BC7C66@global2000.net>, Andrea Ryan 
<ary### [at] global2000net> wrote:

> > This would look like Smalltalk where you can create objects only by
> > inherting it from a preexisting class hierarchy.  But this is only
> > readsay.

My only experience with Smalltalk so far has been a short look at 
Squeak, but it looks like you are right.
Another language that seems to do this is Objective C...though it also 
appears to be possible to make your own root objects, this seems to be 
very rare, and you usually inherit from an Object or NSObject class.

BTW, you seem to be quoting your message body...the only thing that 
didn't look like it was from another message was your signature. :-)
You might want to change whatever setting is causing this, it is 
difficult to read if you aren't expecting it.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Nathan Kopp
Subject: Re: object oriented features
Date: 26 Aug 2000 00:45:32
Message: <39a74b6c$1@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote...
> In article <39a2ff44@news.povray.org> , "Nathan Kopp" <Nat### [at] Koppcom>
> wrote:
>
> > This is very interesting.  Many GUI OS and application designers have
chosen
> > to provide both.  The keyboard shortcuts, which have a higher learning
> > curve, are presented in such a way that experts love them, but newbies
> > ignore them.  Mouse-operated features are used by newbies and experts
alike.
>
> This was not the reason for my question * :-)

I'm still wondering about the reason for your question.  :-)

I'll answer the question, though:  I find keyboard shortcuts _much_ faster
than using the mouse.  I often use the ALT key on my PC to access menus
instead of reaching over for the mouse.  I like to use the mouse only for
pointing tasks, such as selecting text and working with graphics.  However,
if I have the mouse in my hand (when doing pointing-related tasks), it then
becomes more convenient for me to access menus and buttons via the mouse
instead of the keyboard.

If a function can be accessed in multiple ways, I tend to use whichever way
is most convenient at that time.  One single access method is usually not
universally convenient -- it will be most convenient in some situations, but
less convenient in others.

-Nathan


Post a reply to this message

From: Nigel Stewart
Subject: Re: object oriented features
Date: 5 Sep 2000 18:21:36
Message: <39B42E4E.1345ED64@nigels.com>
> It shouldn't be difficult to do, but I can't make much sense of the
> parsing code.

	Isn't is shame that it's not based on something
	standardised, such as XML? :-)

--
Nigel Stewart (nig### [at] nigelscom)
Research Student, Software Developer
Y2K is the new millenium for the mathematically challenged.


Post a reply to this message

From: Chris Huff
Subject: Re: object oriented features
Date: 5 Sep 2000 18:55:28
Message: <chrishuff-A8A25E.17571005092000@news.povray.org>
In article <39B42E4E.1345ED64@nigels.com>, nig### [at] nigelscom wrote:

> 	Isn't is shame that it's not based on something
> 	standardised, such as XML? :-)

Nope.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Warp
Subject: Re: object oriented features
Date: 6 Sep 2000 03:41:42
Message: <39b5f535@news.povray.org>
In povray.general Nigel Stewart <nig### [at] nigelscom> wrote:
: 	Isn't is shame that it's not based on something
: 	standardised, such as XML? :-)

  XML may be easy for a parser to read, but if a newbie (or a oldbie for that
matter) sees povray code in XML he will not understand a word.

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


Post a reply to this message

<<< Previous 22 Messages Goto Initial 50 Messages

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