r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Maxim
1-Sep-2010
[10225x2]
my use cases tend to be on the fringes  ;-)


but I don't want to impede their plan right now.  i can actually 
do (some/all?) of this work myself, since it would effectively be 
a completely separate rendering process than /view, I woudn't be 
competing with their efforts, it could just be an additional extension 
which uses the same AGG code, but with a different REBOL interface
I would also like to build my OpenGL extension, now that I have everthing 
required in the extension API to start work on that.
Pekr
1-Sep-2010
[10227]
Would you need a vector! type for your work? IIRC vectors are still 
not finished in R3, no? Dunno if extensions support them ....
Maxim
1-Sep-2010
[10228x4]
yes vector! is usefull, simply for speed considerations.   not sure 
either, if they where added back in A101/102
MAJOR milestone for Game kit.


test app updated and includes multiple shape collisions and propagation. 
 quite fun  :-)

also: press g to view spatial sorting grid, its a bit mesmerizing 
to see


do http://www.pointillistic.com/open-REBOL/moa/files/ctest-preboled.r
next step... dynamics using rigid bodies
I also want to try adding rotational collision response... i.e. push 
a polygon, and it twists as well as moves.
Pekr
1-Sep-2010
[10232]
if you do a quick drag-move, it can jump over the element, instead 
of pushing it forward .... is that a bug, or na intention?
Maxim
1-Sep-2010
[10233]
that is because I didn't add actor velocity to the collision detection. 
 this will be part of dynamics upgrade.

I'm just happy that propagation already works  :-)
Pekr
1-Sep-2010
[10234]
Interesting that you are able to do it via plain old R2 ....
Maxim
1-Sep-2010
[10235x2]
most of it is math, AGG is just reflecting the vector maths I am 
doing.  its also responsible for about 90% of the CPU use :-(


but for now its not an issue since the game kit doesn't actually 
use these shapes for the user graphics, only for collision detection.
the user graphics are statically bound pre-compiled AGG blocks and 
render much faster, since I use AGG matrix ops directly for all of 
the rendering.
Anton
1-Sep-2010
[10237]
That's very impressive, Max.
AdrianS
1-Sep-2010
[10238]
I can see a way nicer (well, if performance won't be an issue) alternative 
to Processing being built on top of something like this. With dialecting 
and extensions to interface to external hardware, it could be a killer 
app for the interactive/performance art community.

http://www.processing.org/
Maxim
1-Sep-2010
[10239]
yep, this is all built as a set of generic libs you can use in any 
app.


 the actual application-specific code part of this test (if you exclude 
 the event loop, which would be part of a generic toolkit) is 1kb 
 of code (~ 50 lines).
JoshF
2-Sep-2010
[10240]
Hi!


Is there a good way to draw an image with an alpha channel? In the 
example below, I would expect a green outlined circle with a transparent 
background so I could composite it over the red box in the layout 
(for instance). However, I get solid (and very un-transparent) black.


    x: draw 512x512 [pen green line-width 3 fill-pen blue circle 256x256 
    200]
    view layout/tight [box 512x512 red  at 0x0 image x]

Any ideas? Thanks very much!
Maxim
2-Sep-2010
[10241]
alpha is the fourth component of colors... 255 is full transparency.
JoshF
2-Sep-2010
[10242]
I am aware of this, but the draw command seems to start with full 
opacity instead. Any way to get it to be transparent except where 
I've drawn? Thanks!
Maxim
2-Sep-2010
[10243x2]
so there are a few options.


I'd build a transparent image to start and graph stuff over it using 
draw.

ex:

x: make image! 512x512
x/alpha: 255
draw x [fill-pen red circle  256x256 200]
one thing to consider is how transparency relates to color. in the 
above, you will probably get a dark edge around the circle.


that is because the color around the circle actually is darker, so 
even if its partly transparent, it will add transparent dark red 
instead of red.
JoshF
2-Sep-2010
[10245]
That is the missing link! Thank you very much, Maxim!

For what it's worth, it seems that it's possible to skip a step in 
your example by saying:

    x: make image! [512x512 0.0.0.255]


Since, I'm compositing over stuff, the pre-multiplied alpha problem 
you describe shouldn't be a difficulty.
Maxim
2-Sep-2010
[10246]
:-)
Nicolas
5-Sep-2010
[10247]
I'm trying to catch alt-down mouse events while the left mouse key 
is down. Can anyone do this?
Henrik
5-Sep-2010
[10248]
not sure the event system allows this.
Nicolas
5-Sep-2010
[10249x5]
Shouldn't it?
In windows, if I do this then the left mouse down is interrupted 
by the right mouse click
In rebol, the only thing that stops a left mouse drag is left mouse 
up.
How does the event system work?
Surely we can fix this.
Henrik
5-Sep-2010
[10254]
I'm not sure if it's easy to fix. Cyphre would know whether it's 
possible.
Nicolas
5-Sep-2010
[10255]
How do I get in contact with him?
Henrik
5-Sep-2010
[10256x2]
He is usually offline in the weekend, but he may come online tomorrow.
beware though, that this may not be fixable.
Graham
5-Sep-2010
[10258]
I think it's been asked for a few times in the past ...
ICarii
5-Sep-2010
[10259x2]
There is a hotkit file that can be modified to add ALT support but 
then you need to create pass-thru scenarios for general window meta 
commands if you want the application to behave normally - eg ALT-F4 
etc.
s/hotkit/hostkit*
Cyphre
6-Sep-2010
[10261]
Nicolas: It looks in R2 the scenario you described doesn't work (don't 
ask me why, I have no access to the R2 sources). But in R3 you can 
normally detect the RMB while LMB is down.
Maxim
9-Sep-2010
[10262]
does anyone have documentation for the R2 SHAPE subdialect within 
draw?


the rebol.com does doesn't have ANY information on them... and i'm 
totally at loss in trying to figure it out... its just creating random 
shapes for me right now.
Graham
9-Sep-2010
[10263x2]
eh? Lots of examples http://www.rebol.com/docs/draw-ref.html
Does Rebol support holy images? http://synapse-ehr.com/forums/showthread.php?133-VID-delete-area
Henrik
9-Sep-2010
[10265]
try an alpha instead of white.
Graham
9-Sep-2010
[10266]
If you cut part of an image out, the rest of the image collapses 
in.
Graham
12-Sep-2010
[10267]
If you had a requirement to log a user out of an application after 
a period of inactivity... what's the best way to do this?
Gregg
12-Sep-2010
[10268]
I don't know of a single best way. One of the key elements, though, 
is determining what constitues "activity". If you have a central 
command dispatch loop of some kind, and every command that indicates 
activity goes through that makes it easier. Then you probably have 
some kind of default state that is used when the app starts up, and 
you revert to that. Of course, if you have useful state that you 
throw away the user won't be happy.
Graham
12-Sep-2010
[10269]
Hmm... so no way to monitor view events
Anton
13-Sep-2010
[10270]
You could have the remote client app monitor its own View events, 
and when there are some within 5 minutes, send a "I'm still here" 
message to the server. If the server doesn't receive any of those 
for an hour, then logout that client.
Dockimbel
13-Sep-2010
[10271]
Graham: >> help insert-event-func
Graham
13-Sep-2010
[10272]
thanks .. so I can use insert-event-func to monitor global events 
and just pass them on.  If I don't get any user events I can lock 
the screen until the user types in a password
Henrik
13-Sep-2010
[10273]
perhaps you can set a rate on the window face.
Graham
13-Sep-2010
[10274]
I already have one that sends a heart beat to the server