World: r3wp
[rebcode] Rebcode discussion
older newer | first last |
Oldes 23-Nov-2005 [1279x2] | here is example how to use it in real life: do http://box.lebeda.ws/~hmm/rebol/projects/font-tools/latest/test.r |
It would be nice to have possibility to use embedded fonts in Rebol as it's possible with Flash. | |
Volker 25-Nov-2005 [1281] | http://www.complang.tuwien.ac.at/papers/ertl%26gregg04pact.ps.gz |
Oldes 25-Nov-2005 [1282] | I probably missed something, how can I read *.ps files? |
Volker 25-Nov-2005 [1283x2] | Click on them in linxu? Hmm, there is ghostscript for windows too somewhere. |
Mybe google has html in its cache, but i lost the search-page. | |
Oldes 25-Nov-2005 [1285] | What is the advantage of using *.ps files? Is it at least interesting reading? |
Volker 25-Nov-2005 [1286x2] | It was the interesting reading why i choosed it. did not realize the *.ps |
about building a native compiler from an interpeter. | |
Oldes 25-Nov-2005 [1288] | ech 10MB of download just to read a simple text file, I'm not going to read it today. |
Volker 25-Nov-2005 [1289] | abstract: http://csdl2.computer.org/persagen/DLAbsToc.jsp?resourcePath=/dl/proceedings/&toc=comp/proceedings/pact/2004/2229/00/2229toc.xml&DOI=10.1109/PACT.2004.10021 |
Rebolek 25-Nov-2005 [1290] | you can convert ps to pdf on http://www.ps2pdf.comfor free |
DideC 25-Nov-2005 [1291] | ...and it works well! |
Oldes 28-Nov-2005 [1292] | here is example of simple cells animation with custom rebcode's preprocessor --> do http://box.lebeda.ws/~hmm/rebol/projects/boids/latest/rc-cells-1.r |
Geomol 28-Nov-2005 [1293] | hehe funny! :-) |
Oldes 28-Nov-2005 [1294x3] | hm, but now I want to work with decimals as well and wonder if will be faster to use block to store the cell variables, or if I will use my own decimal format and binary structer as I'm using now |
how to write: [ 2 ** exponent ] in rebcode? | |
stupid question:) mul.d i i | |
Rebolek 28-Nov-2005 [1297] | mul.d i i is i ** 2 and not 2 ** i |
Geomol 28-Nov-2005 [1298] | 2 ** exponent: set a 2.0 log-e a mul.d a exponent exp a |
Rebolek 28-Nov-2005 [1299] | or you can use set a 0.693147180559945 to save one instruction |
Oldes 28-Nov-2005 [1300x4] | thanks, but kru, I will save instruction but will deal with rounding error: |
>> x: rebcode [exponent][set a 2.0 log-e a mul.d a exponent exp a return a] x 3.0 == 8.0 >> x: rebcode [exponent][mul.d exponent 0.693147180559945 exp exponent return exponent] x 3.0 == 7.99999999999999 | |
interesting, it looks it will be faster to use rebol blocks to store Rebol values instead of binary format I used in the cell example before (which was faster in the early rebcode versions) | |
do http://box.lebeda.ws/~hmm/rebol/projects/boids/latest/rc-cells-2.r <--- same like the version 1 but without the rebcode preprocessor using Rebol block to store cell variables instead of the binary format. | |
Henrik 28-Nov-2005 [1304] | how do you tell the speed difference? I can't see it.... |
Oldes 28-Nov-2005 [1305] | It's not in the script, I did local tests. |
Henrik 28-Nov-2005 [1306] | how great is the speed difference? |
Oldes 28-Nov-2005 [1307] | using rebol block is 3x faster |
Henrik 28-Nov-2005 [1308] | that's quite a lot... |
Oldes 28-Nov-2005 [1309] | how to get random number between 0 and 1? |
Rebolek 28-Nov-2005 [1310] | I generate random number from 0 to milion and divede it by milion |
Oldes 28-Nov-2005 [1311x3] | :) i fought there will be better method |
so it's: rnd: rebcode[][set d 1000000000 randz d to-dec d div.d d 1000000000.0 return d] | |
how to write atan2(sin,cos) in rebcode? | |
Gregg 29-Nov-2005 [1314] | Oldes, can we include rc-cells on the rebcode demo page? |
Oldes 30-Nov-2005 [1315] | yes, why not |
Gregg 30-Nov-2005 [1316] | Thanks! I just want to make sure we get permission from authors. |
Rebolek 1-Dec-2005 [1317] | can I return error! from rebcode? |
Anton 1-Dec-2005 [1318] | Nice demo Oldes. :) |
Rebolek 1-Dec-2005 [1319] | I rewrote my old 3d demo to rebcode to see the speed difference. But I found that normal rebol can draw 120+ triangles without slowing down and because I became bored adding more objects I stopped testing it :) Anyway, rebcode optimalised (just three or four functions - matrix multiplication, inversion and 3d to 2d conversion - are rewritten to rebcode, it can be optimalized more) version is here - http://krutek.info/rebol/ratrix.r . z-buffer does not work very well as you can see. |
Pekr 1-Dec-2005 [1320x2] | and the speedup is? :-) |
maybe it would be nice to have some button, have functions saved, and toggle between rebcode/non-rebcode version .... | |
Rebolek 1-Dec-2005 [1322] | hm, from my tests, matrix operations are just 3x faster, 3d to 2d conversion is cca. 11x faster. But old rebol-only version can show 120+ triangles without problem so in this simple demo, rebcode is not needed :) |
Pekr 1-Dec-2005 [1323] | :-) hmm, and if you would like to make object movement faster? |
Rebolek 1-Dec-2005 [1324] | To make objects move faster you can just change their speed, it's not rebol vs. rebcode thing :) |
Pekr 1-Dec-2005 [1325] | yes, but if I would like some of them to rotate like mad, rebol limitation would just show, so it might become rebol vs rebcode thing ;-) |
Rebolek 1-Dec-2005 [1326] | rebol limitation may show but it won't be rebol math speed limitation but rebol face refresh speed limitation :) |
Pekr 1-Dec-2005 [1327] | not necessarily - you don't have to refresh more than 24/sec, yet rebol math speed may become limiting factor, depending upon how complex your scene is .... but - I am not here to argue with you about single details, just wanted to see those two versions compared, that is all ... |
Rebolek 1-Dec-2005 [1328] | Pekr as I said, here on this computer, classic rebol is capable of updating more than 120 trinagles at full speed (rate: 0) without problem. And after 120 triangles I became bored adding more so I did not test it :) |
older newer | first last |