Since vectors represent directions, the origin of the vector does not change its value. Because it is more intuitive to display vectors in 2D (rather than 3D) you can think of the 2D vectors as 3D vectors with a z coordinate of 0. If a vector has 2 dimensions it represents a direction on a plane (think of 2D graphs) and when it has 3 dimensions it can represent any direction in a 3D world.īelow you'll see 3 vectors where each vector is represented with (x,y) as arrows in a 2D graph. Vectors can have any dimension, but we usually work with dimensions of 2 to 4. The directions for the treasure map thus contains 3 vectors. ![]() You can think of vectors like directions on a treasure map: 'go left 10 steps, now go north 3 steps and go right 5 steps' here 'left' is the direction and '10 steps' is the magnitude of the vector. A vector has a direction and a magnitude (also known as its strength or length). In its most basic definition, vectors are directions and nothing more. If the subjects are difficult, try to understand them as much as you can and come back to this chapter later to review the concepts whenever you need them. The focus of this chapter is to give you a basic mathematical background in topics we will require later on. However, to fully understand transformations we first have to delve a bit deeper into vectors before discussing matrices. When discussing matrices, we'll have to make a small dive into some mathematics and for the more mathematically inclined readers I'll post additional resources for further reading. Matrices are very powerful mathematical constructs that seem scary at first, but once you'll grow accustomed to them they'll prove extremely useful. This doesn't mean we're going to talk about Kung Fu and a large digital artificial world. There are much better ways to transform an object and that's by using (multiple) matrix objects. We could try and make them move by changing their vertices and re-configuring their buffers each frame, but that's cumbersome and costs quite some processing power. We now know how to create objects, color them and/or give them a detailed appearance using textures, but they're still not that interesting since they're all static objects. Thanks.Transformations Getting-started/Transformations ![]() Hope someony can help me understand this better. f notation (in orientation (1/6.f)) doesnt exist in GLSL. At first sight your shader looks ok, although: It always sets texturecoord.y to 0, which might not be what you want. Maybe I don't understand the effect of order yet. 1 Answer Sorted by: 2 To be able to give a good answer, we need to know what is the compiler error you are referring to. ![]() Yet they look wrong and changing the order also changes the texture look ( top-left top-right bottom -right to top-right bottom-right top-left). To my understanding both should have only a yellow texture. When I create a triangle with vertices +1/+1 +1/-1 -1/+1 and text coordinates 0/0 1/0 1/1 it looks like this: My first triangle with vertices -1/+1 +1/+1 +1/-1 and text coordinates 0/0 1/0 1/1 looks like this: With the functions of OpenCV such as cvFindExtrinsicCameraParams2, cvRodrigues2 I have obtained the rotation vector and rotation matrix. For example: Displaying the box on detected maker. But I have no clue how to integrate those two. My goal is to get the lower yellow triangle regardless of vertex order. One is using OpenCV (for marker detection) and another OpenGL (for creating a simple 3D box). I know the coordinate system according to this link:īut when I change the order of vertices of the same triangle I get strange texture outcomes I don't understand. ![]() I have some issues with understanding texture coordinates.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |