problem with orbit
problem with orbit
1/ i create a new document in odamfcapp
2/ i draw a line parrallel to the y axe
when i do a rotate x the line is not draw correctly (same a z clipping )
if save this file, when i re open it, it work correctly ... strange no?
i have the same pb in my application ....
thierry
can you zip and upload the offending code?
quote:
originally posted by open design alliance
can you zip and upload the offending code?
is in odamfcapp.exe, i think is the creation of a default database with the createdatabase function .... for this part my code is the same ...
thierry
could you explain what do you mean by "is not drawn correctly"?
btw, view changes after zooming/paning/rotating in odamfcapp are not saved to file.
sergey slezkin
thank for your answer,
i upload a pdf file to explain why is not good ....
its only with opengl end opengl cache device, its good with wingdi (but it's impossible to shade), and only when the drawing is a new database ...
thierry
attached files (302.2 kb, 18 views)
to help you ... i hope
i have trace the gsopenglvectorizer.cpp when i open a new drawing (new database) opengl don't go in viewdeptrange .....
and when a object is created (new line new block ...), viewdeptrange is not call and zfar & znear are not updated
with a new database
opengl .......
---------------------------------------------
odgsopenglvectorizeview : update
left 0
bottom 0
width 481
height481
---------------------------------------------
odgsopenglvectorizeview : getglscreenrect
left 0.000000
bottom 0.000000
width 481.000000
height481.000000
---------------------------------------------
odgsopenglvectorizeview : beginviewvectorization
when open a dwg (created before with application)
opengl .......
---------------------------------------------
odgsopenglvectorizeview : update
left 0
bottom 0
width 481
height481
---------------------------------------------
odgsopenglvectorizeview : getglscreenrect
left 0.000000
bottom 0.000000
width 481.000000
height481.000000
---------------------------------------------
odgsopenglvectorizeview : beginviewvectorization
odgsopenglvectorizeview : viewdeptrange
zfar -1.000000
znear 1.000000
--------------------------------------------
last edited by thierry; 28th january 2005 at 04:50 amfff">.
more help
if i add this after create a block
database()->updateext();
extmin and extmax is good :
oddblayoutptr playout = m_layoutid.safeopenobject();
odgepoint3d extmin = playout->getextmin(), extmax = playout->getextmax();
but modelextents in odgsopenglvectorizeview::viewdeptrange return always !extents.isvalidextents() and the zfar and znear value are never update ....
can you help me?
my code :
void ccallbrowserview:

ndropfiles(hdrop hdropinfo)
{
oddbdatabase* l_pdb = static_cast<ccallbrowserdoc*>(getdocument());
oddbblocktableptr l_pblocks;
cstring l_blockname;
if(m_pssetdrawable.isnull())
{
m_pssetdrawable = myssetdrawable::createobject();
}
myssetdrawable* pss = static_cast<myssetdrawable*>(m_pssetdrawable.get() );
pss->m_sset.clear();
/////////////////////////////////////////////////
...
...
bool res = dragquerypoint( hdropinfo, &l_point);
m_startpoint = m_endpoint = l_point;
odgepoint3d start, end;
getworldstartendpoints(start, end);
....
.....
while (myfiles ())
{
myfiles.snextfile (l_buf);
cfile l_file(l_buf,cfile::moderead);
/////////////// creation du bloc ///
l_blockname = l_file.getfiletitle();
l_file.close();
if(m_interactionmode == korbite3d) invalidate();
l_blockname = l_blockname.left(l_blockname.getlength()-4);
l_pblocks = l_pdb->getblocktableid().safeopenobject(oddb::kforwrite) ;
m_idblock = l_pblocks->getat((odstring)l_blockname.getbuffer(0));
if (!m_idblock)
{
odstring l_blockfilename = (odstring)l_buf.getbuffer(0);
oddbdatabaseptr l_pdbblock = theapp.readfile(l_blockfilename, false, false);
m_idblock = l_pdb->insert((odstring)l_blockname.getbuffer(0), l_pdbblock, true);
}
oddbobjectid l_brefid;
m_pnewblockreference = oddbblockreference::createobject();
m_pnewblockreference->setdatabasedefaults(database());
m_pnewblockreference->setblocktablerecord(m_idblock);
if (!theapp.getredliningcur())
{
odstring l_layername = theapp.getredliningname();
odcmcolor l_layercolor;
l_layercolor.setrgb(odgetred(theapp.getredliningco lor()), odgetgreen(theapp.getredliningcolor()), odgetblue(theapp.getredliningcolor()));
m_pnewblockreference->setlayer(addlayer(l_layername));
m_pnewblockreference->setcolor(l_layercolor);
}
////////////////////////////////////
addextendeddata(m_pnewblockreference);
....
....
...
oddbblocktablerecordptr pspace = database()->getactivelayoutbtrid().safeopenobject(oddb::kforw rite);
database()->startundorecord();
l_brefid = pspace->appendoddbentity(m_pnewblockreference);
pss->m_sset.append(l_brefid);
m_pnewblockreference.release();
}
odgescale3d l_scale3d(m_xscale,m_yscale,m_zscale);
odgematrix3d l_xformsel(odgematrix3d::translation(start - odgepoint3d(0,0,0) )*
odgematrix3d::rotation(deg2rad * m_angle, odgevector3d::kzaxis) *
odgematrix3d::scaling(l_scale3d));
if(pss)
{
database()->startundorecord();
pss->transformby(l_xformsel);
database()->updateext();
oddblayoutptr playout = m_layoutid.safeopenobject();
odgepoint3d extmin = playout->getextmin(), extmax = playout->getextmax();
#ifdef _logfile
file* l_logfile;
l_logfile = fopen("c:\\opengl.log","a");
fprintf(l_logfile, " extmin x = %f, y=%f z=%f\n", extmin.x, extmin.y, extmin.z);
fprintf(l_logfile, " extmax x = %f, y=%f z=%f\n", extmax.x, extmax.y, extmax.z);
fprintf(l_logfile, " ---------------------------------------------\n");
fclose(l_logfile);
#endif
redrawwindow();
}
last edited by thierry; 28th january 2005 at 07:01 amfff">.
unfortunately it's defect in 1.12 opengl device. it will be fixed in next release.
as a temporary workaround you can add a function to odgsopenglvectorizeview which will set m_bmodelextentsvalid member to false after adding entities to database. it will force extents updating.
sergey slezkin
thank you sergey,
i try that, and wait for the next release
best regards
thierry