几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】all letters appear at the same position (http://www.dimcax.com/hust/showthread.php?t=15083)

yang686526 2009-05-04 03:55 PM

【转帖】all letters appear at the same position
 
all letters appear at the same position
all letters appear at the same position
hi,
writing an own viewer, i overwrote the function simplepolyline(). everything works fine, except the output of texts. the letters of all strings are drawn at the same position.
what's wrong? thank you!

probably you have problems with block insertions too.
it seems you do not take into account current model transform (getmodeltoworldtransform()).
sergey slezkin

hi sergey,
you are right, block insertions show the same problem.
with getmodeltoworldtransform() each letter of a string is now drawn with the correct position (within the string). but the positions, scales and orientations of the whole strings aren't correct.
it seems that there must be an additional transformation in simplepolyline().

applying modeltoworld matrix to the simplepolyline points you get points in world coordinates.
to get device coordinates (after applying view, projection etc.) objecttodevicematrix() should be used.
sergey slezkin

we want to get everything in world coordinates, because we are using our own view-transformations.
how is it possible to get a matrix within simplepolyline(), which contains the necessary information about the position, scale-factor and orientation of a block or text-entity?
thank you!

if you need world coordinates getmodeltoworldtransform() is the right method.
it seems something is wrong with transformation stack.
maybe you have overriden pushmodeltransform()? if not transformation stack is implemented in base class.
sergey slezkin

hi sergey,
we didn't override pushmodeltransform(). we just have a simple programme with classes derived from odgsbaseview and odgsbasedevice. the only overridden functions are simplepolyline() and update().
we thought that we can get world-coordinates in simplepolyline() to implement our own viewer.
where is the fault?


所有的时间均为北京时间。 现在的时间是 08:11 AM.