From: Rajesh R (rajeshr++at++cair.res.in)
Date: 12/01/2005 02:31:46
Dear Performers,
Following is the code for rendering a sphere along with an Annotation. The
Annotation (string) is visible in my Application. But Sphere is not
visible. Please point out where I am going wrong.
void CPerf::CreateAnnotations()
{
/* Annotation */
pfFilePath("D:\\Program Files\\Silicon Graphics\\OpenGL
Performer\\Data");
m_pAnnFont = pfdLoadFont_type1("times-elfin",
PFDFONT_EXTRUDED);
if (m_pAnnFont == NULL)
{
pfNotify(PFNFY_FATAL,PFNFY_PRINT, "Couldn't find
font - PF TimesNewRoman");
return;
}
m_pAnnGroup = new pfGroup();
for(int i = 0; i < ANN_MAX; i++)
{
m_pAnnText[i] = new pfText();
m_pAnnString[i] = new pfString();
m_AnnMat.makeTrans(m_AnnData.AnnData[i].x,
m_AnnData.AnnData[i].y, m_AnnData.AnnData[i].z + 50);
pfMatrix m2,m3;
m3.makeRot(0.0, 0.0, 0.0, 1.0);
m2.makeScale(100.0, 1.0, 37.0);
m_AnnMat += m2 * m3;
m_pAnnString[i]->setFont( m_pAnnFont );
m_pAnnString[i]->setMat( m_AnnMat );
m_pAnnString[i]->setMode(PFSTR_JUSTIFY,
PFSTR_MIDDLE);
m_pAnnString[i]->setColor(0.0f, 0.0f, 0.0f, 1.0f);
m_pAnnString[i]->setString(m_AnnData.AnnData[i].Name);
m_pAnnString[i]->flatten();
m_pAnnText[i]->addString(m_pAnnString[i]);
m_pAnnGroup->addChild(m_pAnnText[i]);
}
m_pMainScene->addChild(m_pAnnGroup);
//code for sphere
pfGeoSet *arena = (pfGeoSet*)
pfMalloc(sizeof(pfGeoSet),NULL);
if(arena == NULL)
{
int test = 5;
CString str;
str.Format("%d",test);
AfxMessageBox(str);
}
pfGeode* geode;
pfGeoSet *gset;
pfSCS *scs1[ANN_MAX];
pfMatrix m11,m12,m13;
gset = pfdNewSphere(20,arena);
geode = new pfGeode();
geode->addGSet(gset);
for(int j=0;j<ANN_MAX;j++)
{
m12.makeRot(0.0, 0.0, 0.0, 1.0);
m13.makeScale(100.0, 1.0, 37.0);
m11 += m12*m13;
m11.makeTrans(m_AnnData.AnnData[j].x +
10,m_AnnData.AnnData[j].y + 10,m_AnnData.AnnData[j].z+10);
scs1[j] = new pfSCS(m11);
scs1[j]->addChild(geode);
m_pMainScene->addChild(scs1[j]);
}
}
Rajesh.R
Virtual Reality
Institute for Robotics and Virtual Reality
c/o Centre for AI and Robotics
Defence Research and Development Organization (DRDO)
Ministry of Defence
Bangalore - 1
Scientists are people of very dissimilar temperaments
doing different things in very different ways. Among
scientists are collectors, classifiers and compulsive
tidiers-up; many are detectives by temperament and many
are explorers; some are artists and others artisans.
There are poet-scientists and philosopher-scientists and
even a few mystics."
This archive was generated by hypermail 2b29 : Thu Dec 01 2005 - 03:04:49 PST