1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

AndroidGCS OSG: Switch to hardcoded quad model instead of cow. The quad file was made from the 3DS models using

osgconv --enable-object-cache -s 0.01,0.01,0.01 --simplify 0.1 --smooth ~/Programming/OpenPilot/artwork/3D\ Model/multi/joes_cnc/J14-QT_X.3DS quad.osg
to get teh scaling normal for the screen too.
This commit is contained in:
James Cotton 2012-08-21 14:43:53 -05:00
parent f8804574e8
commit f60a6baf3e
3 changed files with 137185 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,10 +43,13 @@ void OsgMainApp::loadModels(){
// Woohoo leaky code. This no longer works for multiple models
uavAttitudeAndScale = new osg::MatrixTransform();
uavAttitudeAndScale->setMatrix(osg::Matrixd::scale(0.2e0,0.2e0,0.2e0));
// Set the rotation to normal
float q[4] = {1.0, 0, 0, 0};
setQuat(q);
osg::MatrixTransform *rotateModelNED = new osg::MatrixTransform();
rotateModelNED->setMatrix(osg::Matrixd::scale(0.05e0,0.05e0,0.05e0) * osg::Matrixd::rotate(M_PI, osg::Vec3d(0,0,1)));
rotateModelNED->setMatrix(osg::Matrixd::rotate(M_PI, osg::Vec3d(0,0,1)));
rotateModelNED->addChild( loadedModel );
uavAttitudeAndScale->addChild( rotateModelNED );

View File

@ -85,7 +85,7 @@ public class OsgViewer extends ObjectManagerActivity implements View.OnTouchList
msgUiLightOn = Toast.makeText(getApplicationContext(), "toast3", Toast.LENGTH_SHORT);
msgUiLightOff = Toast.makeText(getApplicationContext(), "toast4", Toast.LENGTH_SHORT);
String address = Environment.getExternalStorageDirectory().getPath() + "/Models/cow.osg";
String address = Environment.getExternalStorageDirectory().getPath() + "/Models/quad.osg";
Log.d(TAG, "Address: " + address);
osgNativeLib.loadObject(address);
}