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

World: r3wp

[rebcode] Rebcode discussion

Pekr
1-Dec-2005
[1339]
btw - don't you expect any possible rebol 3D engine, even if we have 
rebcode, as simply slow? Isn't the only chance linking rebol to external 
engine/library (e.g. OpenGL)?
Henrik
1-Dec-2005
[1340]
that's probably the only way... also you shouldn't expect to do any 
serious 3D without access to 3D hardware acceleration. it would be 
nice to do this through openGL somehow, but it would take up too 
much footprint to build this into rebol directly
Rebolek
1-Dec-2005
[1341]
As I'm interested only in pure vectors, REBOL speed is succifient 
for me :)) But yes, REBOL can probably be linked to some external 
library (as Cyphre did with OpenGL) or SDL maybe? But I don't think 
it should be high on priority list, other things are more important.
Volker
1-Dec-2005
[1342]
Cool: IMHO the priority should be on moving camera now. And some 
support for collisions, maybe only in 2d-space. Idea: some kind of 
3d-icons. I can live with colored pyramids and some text, but i need 
to move.
Rebolek
1-Dec-2005
[1343]
Volker: there's camera code, but there's probably bug in invert matrix 
function so the camera does not work right now. I'm trying to find 
some informations on that topic and to fix it.
Volker
1-Dec-2005
[1344]
And then we do a 3d-desktop? :)
Rebolek
1-Dec-2005
[1345x2]
distributed 3d desktop nased on rebservices? :)
nased=based
Volker
1-Dec-2005
[1347]
Yes. Something like this atomic modells. Each ball is a site and 
you can move along the connections :)
Rebolek
2-Dec-2005
[1348]
Just a small update: I've fixed matrix inversion so it's possible 
to move camera now. It's not possible to rotate camera but I'm working 
on it.
Oldes
2-Dec-2005
[1349]
nice demo, it's eating almost no CPU on my computer. But if I click 
and move cursor, everything is stoped.
Rebolek
2-Dec-2005
[1350]
that's because mouse events have higher priority than time events 
and the scene is refreshed only when time event occur. If you move 
your mouse, no time-events are generated.
Anton
2-Dec-2005
[1351]
Every event has a time (event/time), so this could be worked around.
Oldes
3-Dec-2005
[1352x2]
Is there someone interested in making dialect form making rebcodes? 
Or someone already doing it?
form = for
DideC
3-Dec-2005
[1354x2]
I think Gabriele has work on that IIRC
work=worked
Oldes
3-Dec-2005
[1356]
Maybe it would be goot to have some registers in rebcode to store 
temporary values which are needed for more cmplex calculations (no 
need to set named variables)
Anton
3-Dec-2005
[1357]
Yeah, I was thinking about that, too. Maybe someone with more experience 
in this area can comment.
Oldes
3-Dec-2005
[1358x4]
Added to Rambo (with bug in the example:( http://www.rebol.net/cgi-bin/rambo.r?id=-505&
and with bug in my english as well: goot = good :(
Fast atan2 function: do http://box.lebeda.ws/~hmm/rebol/rebcode/latest/rc_atan2.r
Based on this C code: http://www.dspguru.com/comp.dsp/tricks/alg/fxdatan2.htm
Anton
3-Dec-2005
[1362]
How accurate is it ?
Oldes
3-Dec-2005
[1363x4]
just do the usage block to see
It could be more accurate, but I don't know how to do [ r^3 ] in 
rebcode (where r is decimal)
But I think the accuracy is fine if you are doing animations and 
effects based on atan2 function - where speed is more important than 
precision
sorry, wrong link, should be: do http://box.lebeda.ws/~hmm/rebol/projects/rebcode/latest/rc_atan2.r
Anton
4-Dec-2005
[1367x3]
Mmm.. It looks slower than ARCTANGENT
Can you put the rebol equivalent (non-rebcode) alongside the atan2 
examples, in the Usage ?
(about 20% slower, by the way. But I'm not confident of my quick 
tests.)
Rebolek
5-Dec-2005
[1370]
How can I access values in objects from rebcode? (when rebcode is 
not in the same context)
Oldes
5-Dec-2005
[1371x2]
Anton: it's logical, Arctangent is one opcode in the rebcode
Kru: I don't know, write it to Rambo as a wish if you wish:)
Rebolek
5-Dec-2005
[1373x2]
Yes, I wish :) I think something like: pick x object value
But maybe it's possible now, I just don't know how.
Anton
5-Dec-2005
[1375]
Oldes, what's the advantage to your rebcode algorithm then ?
Oldes
5-Dec-2005
[1376]
atan2 <> atan
Rebolek
5-Dec-2005
[1377]
atan2 is not very well chosen name, it's pretty confusing. but that's 
not Oldes' fault
Anton
5-Dec-2005
[1378]
Oh I see now. :)
Gregg
5-Dec-2005
[1379]
To access objects, you need to escape out of rebcode. Remember (everyone), 
use rebcode only when you need it.
Rebolek
6-Dec-2005
[1380]
As I work with sound synthesis and 3d graphics I use lot of maths 
so I need rebcode imost of the time :) I had data structures using 
objects, so I rearanged them for now. I wrote it as wish to RAMBO.
Volker
6-Dec-2005
[1381]
You can use 'third, 'get and 'set to turn objects into blocks. only 
from the rebol-side, but maybe it helps a bit.
BrianH
8-Dec-2005
[1382]
Kru, you can use apply in or apply bind to get a word bound to the 
object field, and then use setw and getw to get at the values.
Henrik
12-Dec-2005
[1383]
Continuing from SDK group: I noticed that cyphre thinks pixel writing 
and reading can be a bottleneck in the current rebcode implementation, 
which is why the native convolve functions in rebol/view 1.3.2 are 
much faster than the rebcode version demonstrated earlier.

By providing ways to read and write RGBA information directly without 
needing to extract and combine them first, rebcode could be faster 
at per-pixel operations.

Any thoughts on how to do this?
Pekr
12-Dec-2005
[1384]
allow tuples for rebcode?
Geomol
12-Dec-2005
[1385]
I got an email from Carl at one point regarding this issue. I asked 
to have poking of tuples in rebcode. Carl wrote:

Regarding below, tuple poke not supported on images.
But, perhaps 
it makes sense to add that, eh?


As I also see it, adding support for tuple datatype from within rebcode 
is a good solution. Carl is aware of it, it seems, so just *poke* 
him once more and ask for that. It should also work with PICK of 
course (reading pixels).
Pekr
13-Dec-2005
[1386]
So, has anyone the idea of possible syntax to work with pixels in 
rebcode, so that we could submit an enhancement?
Geomol
13-Dec-2005
[1387x2]
For writing:
poke img 1 255.255.255
or with alpha:
poke img 1 255.255.255.255
I'm a bit in two minds about this. Reading is done with PICK, but 
it'll return an integer. So how to make it return a tuple? Something 
like:
pick.tuple result img 1

Not so good, eh? Maybe we need a TO-TUPLE command in rebcode. And 
how will it influence performance? Maybe it isn't such a great idea 
to add support for tuples to rebcode!?