高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】3d view issue
3d view issue
3d view issue
hi all,
i have a drawing of the opera house, that is a 3d view, and i am using the model view to display.
originally i wrote my own rendering system going through all the entities and working out all the geometry the long hard way. but since on a previous post, i have decided to try the vectorizeex example to make my life easier. however here in lies a funny little problem.
only plotting cacdbline entities at the base of the blocktablerecord, if i plot them using the drawing opera.dwg, they go all over the place (nuclear explosion so to speak), but if i explode the opera.dwg heaviliy in autocad and save it as opera_exploded.dwg, and run the program again, i get a very sensible picture.
now i guess i am doing something incorrect, but i am at a loss to what it could be. i have attached the two drawings for your convenience, if someone wishes to help me. (unfortunately, i could not upload the exploded version of the opera house drawing, it seems to be the size that stops me from doing this. anyhow, to show that it does work ok, just highlight the entire drawing and explode it, i did this about 3 times)
if there is anything else i can do to help with this, please ask.
cheers
jason
ps. oh and thanx in advance to the person who helps me out.
attached files
i recomend you to start debugging your program with simple drawings, opera.dwg is quite complex.
first thing that should be verifyed - didn't you loose the model transform somewhere. create the drawing with two entities - single simple block reference (but with non-identity transform) and circle around it and watch if exploding the block reference changes the view (the relative dispostition of circle and former block reference).
sincerely yours,
george udov
quote:
originally posted by george udov
i recomend you to start debugging your program with simple drawings, opera.dwg is quite complex.
first thing that should be verifyed - didn't you loose the model transform somewhere. create the drawing with two entities - single simple block reference (but with non-identity transform) and circle around it and watch if exploding the block reference changes the view (the relative dispostition of circle and former block reference).
george,
i have been testing simplier drawings, and they are working fantastic, but based on your comment, i think you know the solution, the comment "didn't you loose the model transform somewhere", how do you mean loose. as the vectorizeex simple device / view vectorizes, they just output the points for everything, and i assume the block transformations are taken into account as it goes deeper into blocks into blocks. i assume from your comment this is not the case, so do i have to record the blocks transformation matrix and apply this to vectorized points inside of this block. (this is similiar to what i did with my old 2d drawing engine, but i suspected this geometry simplifier di d all the hard work for me, so i gather i am wrong?)
so is there an easy way to transform an entity object using the block references matrix?
am i just more confused than ever?
cheers
jason
jason,
of course, odvectorizeex returns points with applied model (blocks), view and projection transformations. if your application is based on odvectorizeex and you're loosing model transformation -- you should find difference between your application and vectorizeex.
so recommended way of debug is
1) test odvectorizeex if it does take model transformation into account on file i mentioned in previous post. i think the answer will be "yes".
2) test your application on such file - if it does. i think the answer will be "no".
if answers really are "yes" and "no" -- find difference between your application and vectorizeex.
btw, odgigeometrysimplifier doesn't apply any transforms - just simplifies incoming geometry. model transformations are applied by odgimodeltoviewproc inside gi vectorization framework.
sincerely yours,
george udov
george,
the following is my code in the attachment, and as you can see, it is just odvectorizeex with a very slight change (lots of output of string dumps removed, and very much is as is but with a few name changes.).
is there anything you can see that looks like a straight out problem. i have looked and looked, but i cannot find what the issue is (ie what is different between this code and odvectorizeex code)
also thank you for helping me so far, and hopefully this will soon be resolved.
cheers
jason
attached files (18.6 kb, 18 views)
george,
i also did some more investigation, and i added the following code to vectorizeex
gblinefound = false;
if( pent->isa() == oddbline::desc() ) {
gblinefound = true;
}
odgsbasevectorizeview::draw(pdrawable);
gblinefound = false;
gblinefound is just a simple global, and once it is starting to polyline a line type entiy, i output the vertices to screen only then. i compared these values to the values from my version, and they are exactly the same. i dont believe vectorizeex is supporting 3d drawings like the opera.dwg correctly, because if i plot those co-ordinates, the drawing is completely wrong (well not completly but does not resemble the drawing correctly.)
cheers
jason
anyone else have any idea on whats wrong?
could anyone else please help with this?
still confused as to what is wrong, else i just do the old way i did it originally, and work out all the vectorizing my self. which i might add was thinking this new way is just so much easier and better, would hate to not go down this track. i assume it must be an easy mistake i have made?
stuck.
jason
|