| m11 | m12 | m13 |
| m21 | m22 | m23 |
| m31 | m32 | m33 |
| m11 | m12 | m13 |
| m21 | m22 | m23 |
| m31 | m32 | m33 |
| m11 | m12 | m13 |
| m21 | m22 | m23 |
| m31 | m32 | m33 |
| m11 | m12 | m13 |
| m21 | m22 | m23 |
| m31 | m32 | m33 |
| -m11 | -m12 | -m13 |
| -m31 | -m32 | -m33 |
| m21 | m22 | m23 |
Ogre::Vector3 shipPos; Ogre::Quaternion shipOrientation;The spaceship has an orbiting satelite whose position and orientation (relative to the spaceship) are:
Ogre::Vector3 satelitePosLocal; Ogre::Quaternion sateliteOrientationLocal;
Ogre::Vector3 satelitePosGlobal = ... Ogre::Quaternion sateliteOrientationGlobal = ...
Ogre::Vector3 pointInSateliteSpace;Give code to transform that point into world space:
Ogre::Vector3 pointInWorldSpace = ...
Ogre::Vector3 pointInWorldSpace;Give code to transform that point into satelite space:
Ogre::Vector3 pointInSateliteSpace = ...
class foo
{
foo(int a, char *b, char *c) : x(a) {
strcpy(y,b);
z = new char[strlen(c) + 1];
strcpy(z,c);
}
int x;
char y[10];
char *z;
};
class bar
{
bar(int g, char * h, char *i) : d(g, h, i)
{
e = new foo(g, h, i);
}
foo d;
foo *e;
};
int main()
{
bar v(3, "hello", "there");
bar *vPtr = new bar(5, "test", "string");
// Point A
}
Show the contents of the stack and heap at Point A
#includeclass A { public: void P1() {printf("P1 in A\n");} virtual void P2() {printf("P2 in A\n");} virtual void P3() {printf("P3 in A\n");} }; class B : public A { public: void P1() {printf("P1 in B\n");} void P2() {printf("P2 in B\n");} }; class C : public B { public: void P1() {printf("P1 in C\n");} void P2() {printf("P2 in C\n");} void P3() {printf("P3 in C\n");} }; int main() { A aVar; B bVar; C cVar; A *aPtr = new C(); B *bPtr = new C(); aVar.P1(); aVar.P2(); aVar.P3(); printf("--------\n"); bVar.P1(); bVar.P2(); bVar.P3(); cVar.P1(); cVar.P2(); cVar.P3(); printf("--------\n"); aPtr->P1(); aPtr->P2(); aPtr->P3(); bPtr->P1(); bPtr->P2(); bPtr->P3(); printf("--------\n"); aVar = cVar; aVar.P1(); aVar.P2(); aVar.P3(); printf("--------\n"); bVar = cVar; aPtr = &(bVar); aPtr->P1(); aPtr->P2(); aPtr->P3(); }
r = vABCHowever, you now realize that your system uses column vectors instead of row vectors! Give a formula for the equivalent column vector r' (in terms of the column vector v', and the transformation matrices A, B, and C),