World: r3wp
[rebcode] Rebcode discussion
older newer | first last |
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 :) |
Henrik 1-Dec-2005 [1329] | looks neat, but I think people use more than 120 triangles in their own demos. :-) is it open or flexible enough to be used as a general engine? |
Rebolek 1-Dec-2005 [1330] | Henrik I know that 120 triangles is not that much, but I'm adding them manually, I have no loader for some 3d files, so that was the reason why I stopped :) Basic idea is four years old but I think it can be used as general engines after some little changes. Feel free to look at the code, if you want to. |
Henrik 1-Dec-2005 [1331x2] | I think it would be fun to have a little engine. I'm thinking something like: view 3d-layout [sphere 50 red .... ] etc. :-) |
This is also how Maya is built. A powerful 3D engine and a comprehensive programming language which builds the editor. A little like Emacs. | |
Rebolek 1-Dec-2005 [1333] | There are "entities" like "faces" in View. And 3d "pane". It can be dialected as you wrote. |
Henrik 1-Dec-2005 [1334x2] | a pity pairs don't have a third dimension... otherwise you'd have to use tuples except it would be confusing with positions vs. colours. |
kru, yes I think dialects would be ideal for describing a 3D environment, at least the parts that are not related to motion perhaps. | |
Rebolek 1-Dec-2005 [1336] | i use blocks of decimals for 3d points, it's much more precise |
Pekr 1-Dec-2005 [1337x3] | I remember some talk between Cyphre and Carl about "subpixel accuracy" in regards to AGG, but dunno if related. Carl was thinking if he should allow decimals for pairs IIRC. |
I also remember, that he said that rebol is good fit even for 3D, where 3D is another container, and result put back to face (bitmap). But dunno if I got it right. I doubt it :-) | |
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 [1358x2] | 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 :( | |
older newer | first last |