DIR Return Create A Forum - Home
---------------------------------------------------------
Mobile AR Framework Support Forum
HTML https://mobilear.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Outdoor AR Library
*****************************************************
#Post#: 15--------------------------------------------------
description of the tags of scenes.xml file
DIR By: ceren
Date: December 24, 2012, 7:56 am
---------------------------------------------------------
Hi all,
Thanks Hitlab for providing this Outdoor AR library!
I want to ask if there is any description of the tags of
scenes.xml file. I want to create a campus scene and what I am
defining is, under scenes tag a scene tag and under that
multiple campus building models (under different model tags). Is
it a correct approach or should I create different scenes for
every building? I am confused since there were two scenes tags
in the scenes.xml file of tutorialbasic project and all
displayed on the same scene. What is the meaning of defining
multiple scenes in the xml file if they are displayed in one
scene? Wouldn't it be more meaningful to define multiple models
( box and basketball) under one scenes/scene tag?
Thanks
#Post#: 17--------------------------------------------------
Re: description of the tags of scenes.xml file
DIR By: alia
Date: December 26, 2012, 10:45 pm
---------------------------------------------------------
<scenes>
<scene>
<id>scene1</id>
<name>Taman Bunga</name>
<description>Terdapat banyak bunga di taman ini,
terletak berhampiran di Tasik UTM.</description>
<creator>HITLabNZ</creator>
<models>
<number>1</number>
<model>
<name_model>Taman Bunga</name_model>
<id_model>MrMeow</id_model>
<type>main</type>
<location>
<longitude>103.642024</longitude>
<latitude> 1.558225</latitude>
<altitude>1</altitude>
</location>
<transformation>
<translation>
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</translation>
<rotation>
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</rotation>
<scale>
<X>1.0</X>
<Y>1.0</Y>
<Z>1.0</Z>
</scale>
</transformation>
<animation>
<rotation>
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</rotation>
</animation>
</model>
</models>
</scene>
</scenes>
sorry if i misunderstand you.. the first <scenes> tag for all
scenes.. and then we define each of it in <scene> so if you wnt
to do many type of scenes.. i guess you have to do the <scene>
tag one by one.
#Post#: 18--------------------------------------------------
Re: description of the tags of scenes.xml file
DIR By: alia
Date: December 27, 2012, 8:48 pm
---------------------------------------------------------
one thing i ve being wondering.. is it possible for me to add
more attributes in scenes.xml?? i would like to add scene link..
and i see the androidar.data.scene only have certain variable
and is protected.. uhuhuhuhuh....
#Post#: 19--------------------------------------------------
Re: description of the tags of scenes.xml file
DIR By: hitlabnz
Date: January 8, 2013, 3:40 pm
---------------------------------------------------------
For now, the parser only recognizes the predefined tags.
If you want to add your own tag, you'll have to write your own
xml parser.
BTW, I would recommend staying away from using the XML for scene
description,
but would rather suggest using the SQLite database file.
It is easier to add new field to a SQLite table.
You can extend the OADataManagerAssets class and override the
loadScenes() methods to read your custom fields as below:
@Override
protected void loadScenes() {
if(getDataLoader() != null) {
List<SceneData> loadedScenes =
getDataLoader().getSceneData();
// load custom data fields from the scenes file and add a
custom scene
SQLiteDatabase db = null;
try {
db = SQLiteDatabase.openDatabase(getLocalDbPath(), null,
SQLiteDatabase.OPEN_READONLY |
SQLiteDatabase.NO_LOCALIZED_COLLATORS);
} catch (SQLiteException e) {
e.printStackTrace();
Log.d(TAG, "Error while loading SQLite DB: " +
getLocalDbPath());
return;
}
if(db != null) {
Cursor cursor =
FROM scene AS s", null);
while (cursor.moveToNext()) {
int sceneId = cursor.getInt(0);
for(SceneData sd: loadedScenes) {
if(sd.id == sceneId) {
addScene(new CityScene(sd, cursor.getString(1)));
break;
}
}
}
cursor.close();
db.close();
}
}
}
#Post#: 22--------------------------------------------------
Re: description of the tags of scenes.xml file
DIR By: alia
Date: February 4, 2013, 8:02 pm
---------------------------------------------------------
thanks, ll try that soon.
*****************************************************
Page 1 of 1