Discussion:
global offsets revisited
Steven Riggins
2006-01-14 05:34:51 UTC
Permalink
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
Andreas Raab
2006-01-14 08:07:21 UTC
Permalink
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
Post by Steven Riggins
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
http://impara.de/mailman/listinfo/tweak
Bert Freudenberg
2006-01-14 13:08:01 UTC
Permalink
Post by Andreas Raab
(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 -
Steven Riggins
2006-01-14 16:01:26 UTC
Permalink
You know I had all those pieces heh, but globalBounds always seemed
to be the same as bounds for me. Odd.

Thanks!
Post by Bert Freudenberg
Display flash: (self globalBounds translateBy: Sensor cursorPoint
- self hand position)
Andreas Raab
2006-01-14 20:02:44 UTC
Permalink
Post by Bert Freudenberg
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
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
Steven Riggins
2006-01-14 20:10:26 UTC
Permalink
Post by Andreas Raab
Post by Bert Freudenberg
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
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
Andreas Raab
2006-01-14 21:11:09 UTC
Permalink
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
Steven Riggins
2006-01-14 21:30:37 UTC
Permalink
Post by Andreas Raab
Post by Steven Riggins
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.
Post by Andreas Raab
Post by Steven Riggins
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

Continue reading on narkive:
Loading...