global offsets revisited

View: New views
8 Messages — Rating Filter:   Alert me  

global offsets revisited

by Steven W Riggins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok before you shoot me :) we're trying to simply get some quicktime  
playing at a player's position in a CProjectBuilder.

I've dug around and followed worlds and EToyWorlds etc but I can't  
seem to grasp how to find the project window's offset, so I can tell  
Quicktime where to play (this is for proof of concept work)

Any ideas?

Steve
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: global offsets revisited

by Andreas Raab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For a proof of concept? E.g., a demo? Use this:

        (World findDeeplyA: CProjectMorph) positionInWorld

It's cheesy but it'll do just fine as long as you only have a single
CProjectBuilder.

Cheers,
   - Andreas

Steven Riggins wrote:

> Ok before you shoot me :) we're trying to simply get some quicktime  
> playing at a player's position in a CProjectBuilder.
>
> I've dug around and followed worlds and EToyWorlds etc but I can't  seem
> to grasp how to find the project window's offset, so I can tell  
> Quicktime where to play (this is for proof of concept work)
>
> Any ideas?
>
> Steve
> _______________________________________________
> Tweak mailing list
> Tweak@...
> http://impara.de/mailman/listinfo/tweak
>
>
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: global offsets revisited

by Bert Freudenberg-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am 14.01.2006 um 09:07 schrieb Andreas Raab:

> For a proof of concept? E.g., a demo? Use this:
>
> (World findDeeplyA: CProjectMorph) positionInWorld
>
> It's cheesy but it'll do just fine as long as you only have a  
> single CProjectBuilder.

You can get the current project's absolute screen coordinates by

        Sensor cursorPoint - self hand position

assuming self is some CPlayer. To show the screen bounding box of  
some player:

        Display flash: (self globalBounds translateBy: Sensor cursorPoint -  
self hand position)

which even works for deeply nested and transformed players (Sophie  
uses a scaled coordinate system).

- Bert -

_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: global offsets revisited

by Steven W Riggins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You know I had all those pieces heh, but globalBounds always seemed to be the same as bounds for me.  Odd.

Thanks!

On Jan 14, 2006, at 5:08 AM, Bert Freudenberg wrote:


Display flash: (self globalBounds translateBy: Sensor cursorPoint - self hand position)



_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: global offsets revisited

by Andreas Raab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> You can get the current project's absolute screen coordinates by
>
>     Sensor cursorPoint - self hand position
>
> assuming self is some CPlayer. To show the screen bounding box of  some
> player:
>
>     Display flash: (self globalBounds translateBy: Sensor cursorPoint -  
> self hand position)
>
> which even works for deeply nested and transformed players (Sophie  uses
> a scaled coordinate system).

That's a great (and very evil :-) hack.

Cheers,
   - Andreas
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: global offsets revisited

by Steven W Riggins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 14, 2006, at 12:02 PM, Andreas Raab wrote:

>> You can get the current project's absolute screen coordinates by
>>     Sensor cursorPoint - self hand position
>> assuming self is some CPlayer. To show the screen bounding box of  
>> some player:
>>     Display flash: (self globalBounds translateBy: Sensor  
>> cursorPoint -  self hand position)
>> which even works for deeply nested and transformed players  
>> (Sophie  uses a scaled coordinate system).
>
> That's a great (and very evil :-) hack.

We'll need a sanctioned method for this at some point.   Manly for  
when we are punching through using FFI and the VM has no clue.

Interesting note:  On my Powerbook (the last of breed!) they do  
QuickTime hardware acceleration so our movies live on top of tweak  
objects, etc.  Is kind of interesting, but makes it hard to click on  
a browser :)

However, this mode does provide the best playback - Squeak is  
completely out of the loop.  If we have an occluding region, we'll  
need to drop into form blit mode.

Steve
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: global offsets revisited

by Andreas Raab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Steven Riggins wrote:
> We'll need a sanctioned method for this at some point.   Manly for  when
> we are punching through using FFI and the VM has no clue.

Yes. It's pretty clear what that'll be - namely a "screenTransform"
which is accessible in your top-level scope (world). BTW, the reason why
this doesn't exist yet is mainly that it's not clear to me whether this
transform ought to be (host) window-relative, or (host) display
relative. There are some very good arguments for the latter (e.g., it
makes host window transforms just another part of the transformation
chain) but there are definitely some arguments against it (many, if not
most, "global" positions that we're interested in will be relative to
the window).

> Interesting note:  On my Powerbook (the last of breed!) they do  
> QuickTime hardware acceleration so our movies live on top of tweak  
> objects, etc.  Is kind of interesting, but makes it hard to click on  a
> browser :)
>
> However, this mode does provide the best playback - Squeak is  
> completely out of the loop.  If we have an occluding region, we'll  need
> to drop into form blit mode.

Not necessarily - I'd be surprised if there weren't a way of giving it a
clipping region that overlaps it. You may have to go out of your way to
do that (for example, creating another host window that you put in front
of that region and fill the window with the stuff that's in the back)
but I'm pretty sure there ought to be ways of making this work.

Cheers,
   - Andreas
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

Re: global offsets revisited

by Steven W Riggins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 14, 2006, at 1:11 PM, Andreas Raab wrote:

> Steven Riggins wrote:
>> We'll need a sanctioned method for this at some point.   Manly  
>> for  when we are punching through using FFI and the VM has no clue.
>
> Yes. It's pretty clear what that'll be - namely a "screenTransform"  
> which is accessible in your top-level scope (world). BTW, the  
> reason why this doesn't exist yet is mainly that it's not clear to  
> me whether this transform ought to be (host) window-relative, or  
> (host) display relative. There are some very good arguments for the  
> latter (e.g., it makes host window transforms just another part of  
> the transformation chain) but there are definitely some arguments  
> against it (many, if not most, "global" positions that we're  
> interested in will be relative to the window).

Both.  Really, we'll need both.  If we do our job right, the movies  
in this case will be attached to the host window (We're doing that  
now) so that they get moved around as the host window is moved by the  
OS.

>
>> Interesting note:  On my Powerbook (the last of breed!) they do  
>> QuickTime hardware acceleration so our movies live on top of  
>> tweak  objects, etc.  Is kind of interesting, but makes it hard to  
>> click on  a browser :)
>> However, this mode does provide the best playback - Squeak is  
>> completely out of the loop.  If we have an occluding region,  
>> we'll  need to drop into form blit mode.
>
> Not necessarily - I'd be surprised if there weren't a way of giving  
> it a clipping region that overlaps it. You may have to go out of  
> your way to do that (for example, creating another host window that  
> you put in front of that region and fill the window with the stuff  
> that's in the back) but I'm pretty sure there ought to be ways of  
> making this work.

Well yes :) We discussed this, but calculating this as the frame  
rotates, etc seems like its just better to do it ourselves.

Steve
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak