查看单个帖子
旧 2009-05-04, 03:55 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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?
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)