OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cgmo-webcgm message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [cgmo-webcgm] scale transform


Ulrich,

Your analysis is correct.   "Scale()" as now parameterized only scales about the NVDC Origin (so far everyone agrees that it is NVDC instead of VDC).  There is no center-point parameter for scale().

So to scale about a different NVDC point P (px,py), you would:

translate(-px,-py)
scale(sx,sy)
translate(px,py)

Forrest has said that he is okay with this, now that we clarify the scale center-point as (0,0) NVDC.

IIRC, we might have discussed this long ago, whether scale() ought to have a center-point parameter or not.  Now it does not (and this is similar to the SVG scale transform).  I can't remember our discussion, but we probably figured that a script writer who really wants it can easily include a small utility function in the script.

QUESTION:  I don't care strongly, but slightly prefer to leave as is.  If someone wants to argue to change this, and add center-point parameter to scale() ... now is the time to do it.  Anyone?

Btw, to reiterate (attn all implementors), there is a cut-paste error in 5.7.6 description of 'scale'.  Read the description of the sx and sy parameters:

WRONG!
-----
"[sx] The x coordinate (NVDC) of the reference point about which the scaling operation is defined, as a number in NVDC."
"[sy] The y coordinate (NVDC) of the reference point about which the scaling operation is defined, as a number in NVDC.

(WRONG, because it was cut-pasted from rotate(), without editing correctly.) 

CORRECT
-----
"The scale factor to apply in the NVDC x-direction."
"The scale factor to apply in the NVDC y-direction.

Regards,
-Lofton.


At 10:51 AM 1/26/2009 +0100, Ulrich Läsche wrote:
Lofton,

Of course, NVDC should be the coordinate system.  However, I am a little bit confused.

If I want to rotate, let s say an arrow, in the center of the image, I need to set the rotation point in the center, which we can do.
 

If I want to scale an arrow in the middle of the image, for example, horizontally stretch it by a factor of 2 and vertically squeeze it by a factor of 0.5, can I just assume a scaling operation around the NVDC origin?  Wouldn t I first have to move the arrow to the origin, then scale it and move it back?
 
May be this can all be done with a transform matrix.  I just want to be sure that the test cases are written properly.
 
Regards
Ulrich
 
 
-----Ursprüngliche Nachricht-----
Von: Weidenbrueck, Dieter [mailto:dweidenbrueck@ptc.com]
Gesendet: Monday, January 26, 2009 10:15 AM
An: Lofton Henderson; Forrest Carpenter; WebCGM
Betreff: RE: AW: [cgmo-webcgm] scale transform

 

Lofton and all,

 

the introduction of VDC coordinates is what we always tried to avoid. NVDCs have been introduced to isolate the script writer from the complexity of VDC coordinates. Any transform should use NVDC only, as the spec says.

 

An implementer should easily be able to calculate the offset from VDC (0,0) to NVDC (0,0) when reading the file. This offset is required to be able to respond to any of the DOM calls working with NVDC coordinates.

 

Regards,

Dieter

 

From: Lofton Henderson [mailto:lofton@rockynet.com]
Sent: Montag, 26. Januar 2009 00:40
To: Forrest Carpenter; 'WebCGM'
Subject: RE: AW: [cgmo-webcgm] scale transform

 

Forrest --

[... ALL -- see QUESTION at end...]

Thanks, Forrest.  Among other things, your attention to scale() has uncovered a big editing error in 5.7.6 (description of scale()).

More about the center-point question...

At 02:23 PM 1/25/2009 -0600, Forrest Carpenter wrote:

My interpretation of the scale function is that it simply applies the x and y scale factors to all the coordinates in the APS, this would scale around the (0,0) point in VDCs.


It is my belief that the scale function scales about (0,0) in *NVDC* (or it should do so).  Why?  Well, more or less an accumulation of hints:

1.)  any treatment of any coordinates in Ch.5 is about NVDC.  Section 5.6.1 basically says that NVDC are the coordinates of the DOM.

2.) 5.6.2 continues this and then says,  "Terminology: WebCGM geometric transforms are defined in the two-dimensional NVDC coordinate space. In principle, any rotate and scale operations can be represented by a 2x2 matrix M, which is multiplied by the 2x1 vector represenation for of a point p to apply the transform. A translation by d=(dx,dy) is performed by adding d to p."

3.) A few lines further down:  "3.  scale around the origin (0,0) by factors sx and sy: M = [sx 0 0 sy 0 0]".  Altho' that does not explicitly say "NVDC origin (0,0)", on the other hand everything that goes into the matrix is NVDC oriented, and the point P that you transform by the matrix is NVDC.  So it would lead me to suspect that the center-point of the scale is NVDC.

4.) In 5.7.1.3, all units everywhere are NVDC, and the center-point of the rotate() method is explicitly NVDC.

YIKES!  .....

5.) In 5.7.6, did anyone ever read the definition of the scale() method?!  It is ALL wrong -- it is a copy-paste error of the stuff for the center-point of the rotate() method!

Anyway ... given all these little bits (albeit no single one is conclusive), I would say the center point of the scale is the NVDC Origin.

What does the scale function in SVG do?


http://www.w3.org/TR/SVGMobile12/coords.html#TransformAttribute

WebCGM transforms look like SVG transforms in parameterization -- center-point for rotate, but not for scale.  Beyond that, it may not be useful to look at SVG descriptions, since they chose one explanatory model of transformations (it transforms the coordinate system), and we chose the other -- equally correct but different descriptively.

If the scale function scales around the (0,0) point in NVDCs, then we do not need to add a point to the scale function or a method to get the VDC (0,0) in NVDCs. If it scales around the (0,0) in VDCs then we need to add a point to the scale function or a method to get the VDC (0,0) in NVDCs but not both.


That is my interpretation.

QUESTION to ALL:  does anyone *want* scale to be performed relative to the VDC Origin rather than NVDC origin?  Does everyone agree that it should be NVDC Origin?

If "NVDC" wins, then we have nothing to do but insert a couple little clarifications (and fix the big editorial botch in the 5.7.6 description of scale().)

-Lofton.

 

From: Lofton Henderson [mailto:lofton@rockynet.com]
Sent: Sunday, January 25, 2009 1:47 PM
To: 'Forrest Carpenter'; 'WebCGM'
Subject: Re: AW: [cgmo-webcgm] scale transform

 

Forrest, All --

A comment and a QUESTION:

I have no problem with adding the scale reference point (or center point, or scale-origin point, or however you wish to call it).  For someone who regularly needs to scale around a non-origin point, it is more convenient than having to do translate-scale-translate every time.  (Altho' script writers can easily provide a utility function to do it.)

Before we make the change to the test, let's get everyone to agree about it.  (Adding the scale-center point.)

*** HOWEVER ... ***

Rereading Forrest's message, I am confused about one thing.  We all agree that the 'scale' function fixed point now is (0,0) in NVDC, right?  (Editorial comment:  this should be stated explicitly in the 'scale' method description -- everything else is explicit about NVDC, and the center-point must be (0,0) since it is not settable now.)

It seems like Forrest wants to scale about the *VDC* (not NVDC) origin, but there is no way in DOM to find the VDC-NVDC offset (so he can't set up trn-scl-trn).  Simply adding the NDVC center-point to scale() doesn't solve that.

QUESTION:  Do you want:

1.) scale center-point (NVDC)?  (For convenience, since it is achievable now by trn-scl-trn sequence.)
2.) or do you want the VDC-NVDC offset?  (E.g., a new attribute on WebCGMPicture [1].)  (Adds new capability that is not presently achievable.)
3.) or do you want both?


-Lofton.

[1] http://www.w3.org/TR/2008/WD-webcgm21-20080917/WebCGM21-DOM.html#L5070


At 07:41 PM 1/25/2009 +0100, Ulrich Läsche wrote:

Forrest,

We agree with your request.  In our scale test we earlier used VDC.  Now, with rewriting the test, we should follow the route that you proposed.  The move-scale-move operation is odd in any case.

Regards
Ulrich
 

-----Ursprüngliche Nachricht-----
Von: Forrest Carpenter [mailto:forrest@sdicgm.com]
Gesendet: Saturday, January 24, 2009 12:26 AM
An: 'WebCGM'
Betreff: [cgmo-webcgm] scale transform
 
All,
 
If it not too late, I think we need to add a point in NVDCs to the scale function. In a use case, you might want to enlarge an APS around a point to show more detail while leaving other parts of the drawing unchanged. The simplest method to do this in VDCs is to do a translate such that the point is at (0,0), do the scale transform and then a translate that would move the point back to it s original position. Using NVDCs, you cannot do this unless you have a method of translating the (0,0) in VDCs to NVDCs. Currently there is no DOM function that would enable a user to compute the location in NVDCs of the (0,0) point in the CGM. To fix this we could add a point to the scale function or add functions that would return the location of (0,0) in NVDCs.
 
Regards,
Forrest


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]