create entity from points

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
breakdance
Gnoblar
Posts: 15
Joined: Thu Mar 13, 2008 1:46 am
Location: Bucharest
Contact:

create entity from points

Post by breakdance »

Can pls tell me how to make a entity from a bunch of points (coordinates read from a text file) ? -like a graph for a function
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Use ManualObject instead.
User avatar
breakdance
Gnoblar
Posts: 15
Joined: Thu Mar 13, 2008 1:46 am
Location: Bucharest
Contact:

Post by breakdance »

sinbad wrote:Use ManualObject instead.
ok i will try this, but can u give me an example pls, cuz i'm kinda new to this engine
warmi
Gnoll
Posts: 674
Joined: Sun May 27, 2007 3:56 am
Location: USA

Post by warmi »

Check this out:
http://www.ogre3d.org/wiki/index.php/ManualObject

Make sure to change RenderOperation to be OT_POINT_LIST...
User avatar
breakdance
Gnoblar
Posts: 15
Joined: Thu Mar 13, 2008 1:46 am
Location: Bucharest
Contact:

Post by breakdance »

where did I go wrong!!??

// read coordinates
FILE *fisierX;
FILE *fisierY;

fisierX = fopen("valoriX.txt","rt");//placed in \OgreSDK\bin\debug\
fisierY = fopen("valoriY.txt","rt");

k=0;//integer

ManualObject* manual = mSceneMgr->createManualObject("manual");
manual->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_STRIP);

while ( k<100 )
{
fscanf(fisierX,"%i",&xCitit); //integer
fscanf(fisierY,"%i",&yCitit); //integer
manual->position(xCitit, yCitit, 0.0);
k++;
}


manual->end();
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(manual);

fclose(fisierX);
fclose(fisierY);


it says trere's an error with fscanf
pls help
User avatar
breakdance
Gnoblar
Posts: 15
Joined: Thu Mar 13, 2008 1:46 am
Location: Bucharest
Contact:

Post by breakdance »

i used RenderOperation::OT_POINT_LIST and it's the same...
User avatar
iloseall
Gremlin
Posts: 156
Joined: Sun Sep 14, 2003 3:54 am
Location: Beijing China
Contact:

Post by iloseall »

try to change fscanf format param from %i to %d.
Post Reply