World: r3wp
[AGG] to discus new Rebol/View with AGG
older newer | first last |
Henrik 5-Jun-2006 [815x2] | which is what I figured you wanted to do. you need to make the text at 0x0, rotate it and then translate it to the position you want |
e.g. translate 100x100 rotate 30 text "something" | |
Graham 5-Jun-2006 [817] | or set up a straight line "spline" for the text ... |
Henrik 5-Jun-2006 [818] | possibly |
Graham 5-Jun-2006 [819] | Well, seems to me it should be changed. |
Henrik 5-Jun-2006 [820] | changed in AGG or in the code? |
Graham 5-Jun-2006 [821x5] | Text should rotate at the point where it is being drawn |
in AGG. | |
boxes don't rotate around 0x0 | |
why should text? | |
or do they ?? | |
Henrik 5-Jun-2006 [826x2] | well, if you did that, how would you rotate around another point? I won't argue for one solution or the other, but this approach seems natural enough to me. |
I think they do | |
Graham 5-Jun-2006 [828] | which approach? |
Henrik 5-Jun-2006 [829x3] | 1. first you draw 2. then you rotate 3. then you translate in classic REBOL order |
which means start at 3. :-) | |
speaking of which, it could be fun to see a LOGO like dialect for DRAW. fun for the kids. | |
Graham 5-Jun-2006 [832] | Gregg has one. |
Henrik 5-Jun-2006 [833] | that's good. I don't have to do it then. |
Graham 5-Jun-2006 [834] | do you have to create the kids first? |
Henrik 5-Jun-2006 [835] | got plenty of those around, not mine though. I don't know how interested they would be in it yet. I spent countless hours in COMAL80 when I was a kid drawing with the "turtle". |
Graham 5-Jun-2006 [836x2] | Comal80 - a Danish product? |
I remember I had a Comal80 interpreter for my C64. | |
Henrik 5-Jun-2006 [838x3] | I don't remember what it was. I think it was for several platforms but I used it for my C64. |
I think it was a great drawing tool. very straight forward approach to drawing. | |
then I got an Amiga and was exposed to the horror that was Amiga Basic. | |
Graham 5-Jun-2006 [841x3] | I've got my graphing utility written now in my postscript dialect |
just labelling the y-axis is a problem because of the way AGG does the rotate vs PostScript rotate command | |
and there's no way to save a graphic state in AGG. | |
Henrik 5-Jun-2006 [844] | ah, yeah that could be a problem |
Anton 5-Jun-2006 [845x4] | Graham, AGG rotation: that's just an effect of the way AGG does its transformations which apply to the whole image. The rotate command is just a shortcut method of specifying just the rotation angle of a transformation. |
transform (origin) (angle) (scale-x) (scale-y) (translate) | |
What you want to do is set the origin to the centre of your object, then change the angle and translate as you wish. | |
I agree that it is a bit uncomfortable at first. I was also expecting something simpler like in flash, but I suppose this way is more powerful. | |
Cyphre 5-Jun-2006 [849x3] | Anton is right. DRAW works on lower level than FACE so there is only one tranformation matrix per DRAW block (ie. it is applied on all rendered primitives). OTOH you have relatively wide range of commands how to control the transformation matrix or even use the mtrick stack to push/pop different trnasformation states to apply nested transfromations. |
(Note that due this lower-level approach the drawing is also faster.) | |
The transformation handling is more simmilar to OpenGL in that way. See some OGL docs to get the idea and you will see the benefits. | |
Geomol 4-Dec-2006 [852] | Is there a reason, why SPLINE doesn't draw anything with just two points? view layout [box effect [draw [pen black spline 10x10 90x90]]] |
Anton 5-Dec-2006 [853] | Well, SPLINE is only drawing straight lines for me. Maybe you want CURVE. |
Cyphre 5-Dec-2006 [854] | Geomol: the SPLINE has currently 3 and more points allowed as it was meant to use more as spline not line but we can change this. |
Geomol 5-Dec-2006 [855] | Cyphre, it makes sense to have spline draw a line with only two points in a gfx application, where the user start a line with two points and may continue with more points or may just end the line after only two points. |
Graham 5-Dec-2006 [856] | can't the drawing application change it to a line if it ends in two points? |
Maxim 7-Dec-2006 [857x2] | is there any way to extract curvature X/Y data from any of the primitives? |
example, sliding objects on a path, connecting lines along splines, etc... | |
Geomol 7-Dec-2006 [859] | Maxim, maybe a Bezier curve is what, you're after? Try do http://www.fys.ku.dk/~niclasen/rebol/fysik/bezier.r You can find the Bezier function inside the script. |
Cyphre 8-Dec-2006 [860] | Maxim: I have been thinking about that feature many times. It would be great to be able get back the X/Y data of DRAW shapes. This should be part of R3 for sure. Don't know if Carl would like to backport it to R2. We will see. At the moment you can compute the curves in rebol directly (like Geomol does). |
Maxim 8-Dec-2006 [861x4] | will they be pixel perfect? |
Cyphre, was has to be done for R3 IMHO is a way for us to probe values, just like a 3d package allows you to get point, edge, curvature info out of transforming and deforming geometry. | |
although some will argue this is slow, its actually VERY fast, since the slow part is usually the calculation and drawing. once that is resolved, probing is insignificant. | |
using liquid I am already able to build a draw network, which recycles values and allows multiple elements to cooperate. but I can't get that within each element itself. | |
older newer | first last |