What does a Vector3 and Quaternion look like in code? Programming Software Development by Doogledude123 I'm looking for what exactly is a Vector3 (or any Vector for that matter) and also what a Quaternion is in code? What are the variables types? Should you have multiple classes for each type? Thanks! Re: What does a Vector3 and Quaternion look like in code? Programming Software Development by gusano79 … (or any Vector for that matter) and also what a Quaternion is in code? What are the variables types? Should you… Non-sane values when passing to return Programming Software Development by Excizted …+arg.y, z+arg.z); } [/CODE] Quaternion Class [CODE] class Quaternion { float x, y, z; ... }; Vector3 Quaternion::operator *(const Vector3& v) const… result = pre_result; return result; } [/CODE] I have a Quaternion as so: [CODE]Quaternion q(0.0120516298, 0.594058931, -0.00890144333, 0.804294169… Re: Non-sane values when passing to return Programming Software Development by Excizted …worry :) [QUOTE=StuXYZ;1263570] Note that I have made your quaternion a double since any real use with them is going… all the methods of my Vector3 class as well as Quaternion class, and none of these has been suffering from incorrectness…good 3D mathematician, so I've basically just wrote my Quaternion class from a book, which is one of the reasons… Re: Non-sane values when passing to return Programming Software Development by StuXYZ … have a Vector3, why no create the quaternion with the Vector3 + W. [code=c++] class Quaternion { double w; Vector3 Qvec; public: …// ..... }; [/code] Note that I have made your quaternion a double since any real use with them is going…(0,0,-1), what do you think the quaternion should be please? I was just about to … Re: Non-sane values when passing to return Programming Software Development by Excizted … and creating copy constructor and assignment operators for Vector3 and Quaternion. [CODE]Vector3(const Vector3& v) : x(… = v.z; return *this; } [/CODE] and for Quaternion: [CODE]Quaternion(const Quaternion& q) : x(q.x), y(q.y), z…(q.z), w(q.w) { } inline Quaternion& operator= (const Quaternion& q) { x = q.x; y = … Re: Non-sane values when passing to return Programming Software Development by StuXYZ … better done this way. [code=c++] Vector3 Quaternion::rotate(const Vector3& v) const { Quaternion qV(0.0,v); // Set the w… 0, and the x,y,z to the vector v Quaternion RV=(*this) * RV* this->inverse(); // inverse: return the quaterion… Re: Non-sane values when passing to return Programming Software Development by Excizted …? [/QUOTE] It is only returning a const Vector3, if the Quaternion is constant. Note the "const" is not in… exact purpose? [/QUOTE] Was a mistype in the original post, Quaternion contains x, y, z, w. [QUOTE=firstPerson;1263526] Unless, your… Re: Non-sane values when passing to return Programming Software Development by StuXYZ …. e.g. if you change your quaternion.cpp, then type make, I expect only quaternion to be compiled before linking. It will… Re: Non-sane values when passing to return Programming Software Development by Excizted …. e.g. if you change your quaternion.cpp, then type make, I expect only quaternion to be compiled before linking. It will… Re: Non-sane values when passing to return Programming Software Development by Excizted I tried to copy the [CODE]Vector3 Quaternion::operator *(const Vector3& v) const { Vector3 v2, v3; Vector3 … + v3; Vector3 result = pre_result; return result; }[/CODE] to [CODE]void Quaternion::temp(const Vector3& in, Vector3& out) const { Vector3… Re: Non-sane values when passing to return Programming Software Development by Excizted … spent so long creating the post, yet it has errors. Quaternion ofcourse contains not just XYZ but XYZW. The order of… Re: Non-sane values when passing to return Programming Software Development by arkoenig Can you show us what your copy constructors and assignment operators are for Vector3 and Quaternion? C++ Overloading problem Programming Software Development by clement99 …, B, C, D, E; cout << "Enter first quaternion, format a + bi + cj + dk: "; cin >> A…; cout << "Enter second quaternion, format a + bi + cj + dk: "; cin >> B… Googlopedia? Community Center Geeks' Lounge by MattEvans …[/B] deterministic horse cabbage spider dns http soul dot product quaternion cigarette television window chair coffee permanent marker religion smoothie lamp… help needed Programming Software Development by toolbox03 How do I overload the input and + operator for quaternion class? image processing Community Center by anushiya can anyone tell me some project titles on COLOR TEXTURE SEGMENTATION USING QUATERNION GABOR FILTER AND BARKTEV DATABASE AS BACKEND. I searched the google and i need some more papers which are other than in google Strange OGRE Errors Programming Software Development by Rishikeshan … by linking to __imp___ZN4Ogre20ResourceGroupManager30AUTODETECT_RESOURCE_GRO UP_NAMEE (auto-import) Info: resolving Ogre::Quaternion::IDENTITY by linking to __imp___ZN4Ogre10Quaternion8IDENTITYE (auto-import) Info: resolving Ogre… C# XNA Multiplayer tutorials/hints? Programming Game Development by Karkalash …case MessageType.UpdatePlayerRot: { otherPlayer.transform.rotation = new Quaternion(packetReader.ReadVector3(), (float)packetReader.ReadDouble()); break; } case… Re: XNA game Programming Game Development by Xomy …//Audio AudioEngine audioEngine; SoundBank soundBank; WaveBank waveBank; //Quaternions Quaternion rotation = Quaternion.Identity; Quaternion driveRot = Quaternion.Identity; Quaternion driveRot2 = Quaternion.Identity; //Floats float moveShip = 0.0f; float… Re: Object Rotation using Quaternions (XNA) Programming Game Development by DaveTELFA … point of the four smaller cubes on one face] cubeRotation = Quaternion.Identity; then float rightleftrot = 0.0f; keyboardState keys = Keyboard.getState… = -0.1f; if(key.down(right)) rightleftrot = 0.1f; Quaternion addRot = Quaternion.CreateFromAxisAngle(Vector3(centre point of the four smaller cubes), rightleftrot… Re: Object Rotation using Quaternions (XNA) Programming Game Development by DaveTELFA Right, so far I have managed to create a Quaternion for rotation. Only problem is now, how do I …(Keys.Up)) { updownRotation = 0.1f; } // rotation around axis Quaternion addRot = Quaternion.CreateFromAxisAngle(new Vector3(1.0f, 0.0f, 0.0f), leftrightRot… Re: C++ Class Problem Programming Software Development by StuXYZ …is correct. You should not be using pointers in your quaternion class, but I believe that FP has made a tiny… tiny mistype: Conjugate of a quaternion is normally [code=c++]# void CQuaternion::conjugate()const { return …the class, because you normally would write this, [code=c++] Quaternion Q(3,-4,5,-6); double Weight=(Q * Q.conj… Re: Word Association Game Community Center Geeks' Lounge by )BIG"B"Affleck square -->Quaternion algebra Re: Equation? Programming Software Development by toolbox03 …;> overload. istream& operator >> (istream& in, Quaternion& rhs) { in >> rhs.a; in.ignore(); in… Re: Equation? Programming Software Development by Radical Edward …())) in.ignore(); } istream& operator>>(istream& in, Quaternion& rhs) { in >> rhs.a; SkipNonNumeric(in); in… Re: Equation? Programming Software Development by toolbox03 …())) in.ignore(); } istream& operator>>(istream& in, Quaternion& rhs) { in >> rhs.a; SkipNonNumeric(in); in… Re: Precision in unit tests? Programming Software Development by StuXYZ … type of problems. For example, you apply some matrix and quaternion rotations to some vectors, and you want to know if… Re: How is math involved in video games??? Programming Game Development by Ariste Ever think about the math required to position and orient an object in 3D space? If you're not familiar with terms like vector, matrix, and quaternion, look 'em up. Each one of them is used in 3D math. That's just one example. Re: Object Rotation using Quaternions (XNA) Programming Game Development by DaveTELFA …: [code]class Cube { public Vector3 Scale; public Vector3 Position; public Quaternion Rotation; public Matrix WorldMatrix { return Matrix.CreateFromQuaternion(Rotation) * Matrix.CreateScale…