View Full Version : Update Object VRML?
marcioaduarte
May 3rd, 2005, 10:39 PM
Hello! I am developing a project at University. I would like to
know how to update the VRML object in my scene.
The problem is, after I start my scene, when I change my file .wrl,
the scene is not updated. I mean, the scene continues showing the
object that was read at first time.
I need to update the scene on line.
Where is the file that Artoolkit uses to read the object?
How can I change it?
[]s,
Marcio.
Friedbert
May 5th, 2005, 03:29 AM
Hello
Try this code.
It works for me.
in the file:
simpleVRML.c
...
// Object Data.
static char *gObjectDataFilename = "Data/object_data_vrml1";
static ObjectData_T *gObjectData;
static int gObjectDataCount;
...
...
static void Keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 0x1B: // Quit.
case 'Q':
case 'q':
Quit();
break;
case '1':
gObjectDataFilename = "Data/object_data_vrml1";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '2':
gObjectDataFilename = "Data/object_data_vrml2";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '3':
gObjectDataFilename = "Data/object_data_vrml3";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '4':
gObjectDataFilename = "Data/object_data_vrml4";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '5':
gObjectDataFilename = "Data/object_data_vrml5";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '6':
gObjectDataFilename = "Data/object_data_vrml6";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '7':
gObjectDataFilename = "Data/object_data_vrml7";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '8':
gObjectDataFilename = "Data/object_data_vrml8";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
case '9':
gObjectDataFilename = "Data/object_data_vrml9";
gObjectData=NULL;
gObjectDataCount=0;
arVrmlFree(0);
arFreePatt(0);
demoARSetupMarkersObjects();
break;
...
The Code could probably be better cause its my first c Code.
If you need more explanations,please write.
Friedbert
marcioaduarte
May 9th, 2005, 08:08 AM
Friedbert, thank you very much for its attention.
I will try to give a modified and to see its code it can be adapted mine.
What the function demoARSetupMarkersObjects () does she do?
But I am thinking won't give right, it is because I created a timer, where I am going inserting in the code of the file wrl that time. But only that the files wrl is being modified in real time, but its modifications are not exhibited, only when I close the program and I execute him again he shows the last modification that had happened during the previous compilation.
I don't know if you understood what am wanting to say.
But I will give a glance in which you passed me, and I speak to it that happened!
Thank you same,
M?rcio.
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.