Search Results

Search found 438 results on 18 pages for 'plane'.

Page 1/18 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • 3D line plane intersection, with simple plane

    - by clamp
    hello, i have two points in 3D space which have X-coordinates with different signum. so one of them lies definitely on one side of the X-plane and one on the other. now i want to find the intersection of this plane and the line made up by the two points in the most simple and optimized way. i know how to do general line plane intersection, but since in this case the plane is just the x-plane, i think there should be some shortcuts i can take. thanks!

    Read the article

  • Projection matrix + world plane ~> Homography from image plane to world plane

    - by B3ret
    I think I have my wires crossed on this, it should be quite easy. I have a projection matrix from world coordinates to image coordinates (4D homogeneous to 3D homgeneous), and therefore I also have the inverse projection matrix from image coordinates to world "rays". I want to project points of the image back onto a plane within the world (which is given of course as 4D homogeneous vector). The needed homography should be uniquely identified, yet I can not figure out how to compute it. Of course I could also intersect the back-projected rays with the world plane, but this seems not a good way, knowing that there MUST be a homography doing this for me. Thanks in advance, Ben

    Read the article

  • Projection on a plane using a 2*3 matrix

    - by leipäjuusto
    Hello, I can easily draw the projection of a 3D set of points onto the plane with normal vector (1,1,1), by using the matrix (-sqrt(3)/2 sqrt(3)/2 0) (-1/2 -1/2 1). I want to do the same thing, but for a projection onto an arbitrary plane with normal vector (a,b,c) instead of (1,1,1). How to find the matrix? Thanks in advance!

    Read the article

  • Project collision shapes to plane for 2.5D collision detection

    - by Jkh2
    I am working on a top down 2.5D game. In the game anything that overlaps on the screen should be 'colliding' with each other regardless of whether they are on the same plane in the 3D world. This is illustrated below from a side-ways view: The orange and green circles are spheres floating in the 3D world. They are projected onto a plane parallel to the viewport plane (y = 0 in the image) and if they overlap there is a collision event between them. These spheres are attached to other meshes to represent the sphere bounding boxes for collisions. The way I plan to implement this at the moment is the following: Get the 3D world position at the center of the sphere. Use Camera.WorldToViewportPoint to project the point to the viewport plane. Move a Sphere Collider with the radius of the sphere to that point. Test for collisions using unity colliders. My question is how to extend this to work for rotated cuboids. For instance if I have two rotated cuboids, if I follow the logic above it would not work as intended as the cuboids may not collide but they could still be intersected on the view plane. An example is below: Is there a way to project a cuboid that would be aligned with the plane? Would it be a valid cuboid for all rotations if I did this?

    Read the article

  • How to partition a plane

    - by puls200
    Let's say I have a fixed number (X) of points, e.g. coordinates within a given plane (I think you can call it a 2-D point cloud). These points should be partitioned into Y polygons where Y < X. The polygons should not overlap. It would be wonderful if the polygons were konvex (like a Voronoi diagram). Imagine it like locations forming countries. For example, I have 12 points and want to create 3 polygons with 4 points each. I thought about creating a grid which covers the points. Then iterate across the points, assigning them to the closest grid cells. Maybe I miss the obvious? I am sure there are better solutions. Thanks, Daniel I just found an optimization (kmeans++) .Maybe this will yield better results..

    Read the article

  • Getting plane slices from array data

    - by umanga
    Greetings all, I read 3d grid data (from multiple TIF images) into a structure as follows : typedef struct VolumeData{ int nx; int ny; int nz; unsigned char *data; // size is nx*ny*nz } Now I want to get the plane slices from this 1-D grid data: eg: unsigned char* getXYPlaneStack(VolumeData *vol,int z); I could implement above function because the *data array stores image stack. But i am having difficult time implement along the other axes: unsigned char* getYZPlaneStack(VolumeData *vol,int x); and unsigned char* getXZPlaneStack(VolumeData *vol,int y); any easy algorithm for this? thanks in advance.

    Read the article

  • Plane projection and scale causing bluring in silverlight

    - by Andy
    Ok, So I've tried to make an application which relies on images being scaled by an individual factor. These images are then able to be turned over, but the use of an animation working on the ProjectionPlane rotation. The problem comes around when an image is both scaled and rotated. For some reason it starts bluring, where a non scaled image doesn't blur. Also, if you look at the example image below (top is scaled and rotated, bottom is rotated) the projection of the top one doesn't even seem right. Its too horizontal. This this the code for the test app: <UserControl x:Class="SilverlightApplication1.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> <Canvas x:Name="LayoutRoot" Background="White"> <Border Canvas.Top="25" Canvas.Left="50"> <Border.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="3" ScaleY="3" /> </TransformGroup> </Border.RenderTransform> <Border.Projection> <PlaneProjection RotationY="45"/> </Border.Projection> <Image Source="bw-test-pattern.jpg" Width="50" Height="40"/> </Border> <Border Canvas.Top="150" Canvas.Left="50"> <Border.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="1" ScaleY="1" /> </TransformGroup> </Border.RenderTransform> <Border.Projection> <PlaneProjection RotationY="45"/> </Border.Projection> <Image Source="bw-test-pattern.jpg" Width="150" Height="120"/> </Border> </Canvas> </UserControl> So if anyone could possible shed any light on why this may be happening, I'd very much appreciate it. Suggestions also welcome! :)

    Read the article

  • Reflections based on distance from plane

    - by Andrea Benedetti
    Let's consider, for example, a surface like the volleyball court, we can see that legs and shoes of the players are reflected, with a blur effect, but body and stadium don't (as each object not near to the court). I've already made a reflection effect, but it works as a specular reflection, and I need to achieve an effect like the photo above. So, I would like to make a reflection that is based on the distance between the object and the plane, in this manner a close object would reflect more than an object that is positioned far away from the plane. What is the best way to achieve this effect? My first idea was to use the depth value (taken from the reflected camera), and use that value to blend between reflection and court. But I don't know if it's a correct way. Edit: as rendering engine I use Ogre that already provides a reflections system: reflecting the camera through a plane (obviously I can select the models to draw from the reflected camera). After a render to texture pass I can blend the reflected texture with the original plane. So, if possible, I'm looking for a way that best suits my system.

    Read the article

  • Determine corners of a specific plane in the frustum

    - by Takumi
    I'm working on a game with a 2D view in a 3D world. It's a kind of shoot'em up. I've a spaceship at the center of the screen and i want that ennemies appear at the borders of my window. Now i don't know how to determine positions of the borders of the window. For example, my camera is at (0,0,0) and looking forward (0,0,1). I set my spaceship at (0,0,50). I also know the near plane (1) and the far plane(1000). I think i'd have to find the 4 corners of the plane in the frustum whose z position is 50, and with these corner i can determine borders. But i don't know how to determine x and y.

    Read the article

  • Portal View/Projection Matrix near plane

    - by melak47
    For RenderToTexture/Camera based portal rendering, the basics seems simple enough. However, with a free camera, most of the time it is going to be looking at such portals at an angle: Now a regular near clipping plane will not always work here, it will either intersect with the wall the portal is sitting on, or possibly with objects in front of the wall. The desired near clipping plane would be aligned like the portal, producing a view volume more like this: or this in 3D: So here is my question: How does one construct or "truncate" a view/projection matrix to achieve such an off-camera-normal (near) clipping plane?

    Read the article

  • Ray Intersecting Plane Formula in C++/DirectX

    - by user4585
    I'm developing a picking system that will use rays that intersect volumes and I'm having trouble with ray intersection versus a plane. I was able to figure out spheres fairly easily, but planes are giving me trouble. I've tried to understand various sources and get hung up on some of the variables used within their explanations. Here is a snippet of my code: bool Picking() { D3DXVECTOR3 vec; D3DXVECTOR3 vRayDir; D3DXVECTOR3 vRayOrig; D3DXVECTOR3 vROO, vROD; // vect ray obj orig, vec ray obj dir D3DXMATRIX m; D3DXMATRIX mInverse; D3DXMATRIX worldMat; // Obtain project matrix D3DXMATRIX pMatProj = CDirectXRenderer::GetInstance()->Director()->Proj(); // Obtain mouse position D3DXVECTOR3 pos = CGUIManager::GetInstance()->GUIObjectList.front().pos; // Get window width & height float w = CDirectXRenderer::GetInstance()->GetWidth(); float h = CDirectXRenderer::GetInstance()->GetHeight(); // Transform vector from screen to 3D space vec.x = (((2.0f * pos.x) / w) - 1.0f) / pMatProj._11; vec.y = -(((2.0f * pos.y) / h) - 1.0f) / pMatProj._22; vec.z = 1.0f; // Create a view inverse matrix D3DXMatrixInverse(&m, NULL, &CDirectXRenderer::GetInstance()->Director()->View()); // Determine our ray's direction vRayDir.x = vec.x * m._11 + vec.y * m._21 + vec.z * m._31; vRayDir.y = vec.x * m._12 + vec.y * m._22 + vec.z * m._32; vRayDir.z = vec.x * m._13 + vec.y * m._23 + vec.z * m._33; // Determine our ray's origin vRayOrig.x = m._41; vRayOrig.y = m._42; vRayOrig.z = m._43; D3DXMatrixIdentity(&worldMat); //worldMat = aliveActors[0]->GetTrans(); D3DXMatrixInverse(&mInverse, NULL, &worldMat); D3DXVec3TransformCoord(&vROO, &vRayOrig, &mInverse); D3DXVec3TransformNormal(&vROD, &vRayDir, &mInverse); D3DXVec3Normalize(&vROD, &vROD); When using this code I'm able to detect a ray intersection via a sphere, but I have questions when determining an intersection via a plane. First off should I be using my vRayOrig & vRayDir variables for the plane intersection tests or should I be using the new vectors that are created for use in object space? When looking at a site like this for example: http://www.tar.hu/gamealgorithms/ch22lev1sec2.html I'm curious as to what D is in the equation AX + BY + CZ + D = 0 and how does it factor in to determining a plane intersection? Any help will be appreciated, thanks.

    Read the article

  • planar shadow matrix and plane b value

    - by DevExcite
    I implemented planar shadows with the function D3DXMatrixShadow. As you know, we need plane and light factor to calculate a shadow matrix. The problem is that when I set the plane as D3DXPLANE p(0, -1, 0, 0.1f), the shadows by directional light are correctly rendered, but the shadows by point light are not rendered. However, if I use D3DXPLANE p(0, 1, 0, 0.1f), the situation is reversed, shadows by directional light are not drawn, the shadows by point light are ok. I cannot understand why it happens. Is it normal or am i missing something? Please explain to me why this happens. Thanks in advance.

    Read the article

  • LWJGL: Camera distance from image plane?

    - by Rogem
    Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = Display.getAvailableDisplayModes(); for (int i = 0; i < d.length; i++) { if (d[i].getWidth() == args[0] && d[i].getHeight() == args[1] && d[i].getBitsPerPixel() == 32) { displayMode = d[i]; break; } } Display.setDisplayMode(displayMode); Display.create(); } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static void initGL() { GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); GL11.glClearDepth(1.0); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GLU.gluPerspective(45.0f, (float) displayMode.getWidth() / (float) displayMode.getHeight(), 0.1f, 100.0f); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST); } So, with the camera and screen setup out of the way, I can now ask the actual question: How do I know what the camera distance is from the image plane? I also would like to know what the angle between the image plane's center normal and a line drawn from the middle of one of the edges to the camera position is. This will be used to consequently draw a vector from the camera's position through the player's click-coordinates to determine the world coordinates they clicked (or could've clicked). Also, when I set the camera coordinates, do I set the coordinates of the camera or do I set the coordinates of the image plane? Thank you for your help. EDIT: So, I managed to solve how to calculate the distance of the camera... Here's the relevant code... private static float getScreenFOV(int dim) { if (dim == 0) { float dist = (float) Math.tan((Math.PI / 2 - Math.toRadians(FOV_Y))/2) * 0.5f; float FOV_X = 2 * (float) Math.atan(getScreenRatio() * 0.5f / dist); return FOV_X; } else if (dim == 1) { return FOV_Y; } return 0; } FOV_Y is the Field of View that one defines in gluPerspective (float fovy in javadoc). This seems to be (and would logically be) for the height of the screen. Now I just need to figure out how to calculate that vector.

    Read the article

  • Unexpected results for projection on to plane

    - by ravenspoint
    I want to use this projection matrix: GLfloat shadow[] = { -1,0,0,0, 1,0,-1,1, 0,0,-1,0, 0,0,0,-1 }; It should cast object shadows onto the y = 0 plane from a point light at 1,1,-1. I create a rectangle in the x = 0.5 plane glBegin( GL_QUADS ); glVertex3f( 0.5,0.2,-0.5); glVertex3f( 0.5,0.2,-1.5); glVertex3f( 0.5,0.5,-1.5); glVertex3f( 0.5,0.5,-0.5); glEnd(); Now if I manually multiply these vertices with the matrix, I get. glBegin( GL_QUADS ); glVertex3f( 0.375,0,-0.375); glVertex3f( 0.375,0,-1.625); glVertex3f( 0,0,-2); glVertex3f( 0,0,0); glEnd(); Which produces a reasonable display ( camera at 0,5,0 looking down y axis ) So rather than do the calculation manually, I should be able to use the opengl model transormation. I write this code: glMatrixMode (GL_MODELVIEW); GLfloat shadow[] = { -1,0,0,0, 1,0,-1,1, 0,0,-1,0, 0,0,0,-1 }; glLoadMatrixf( shadow ); glBegin( GL_QUADS ); glVertex3f( 0.5,0.2,-0.5); glVertex3f( 0.5,0.2,-1.5); glVertex3f( 0.5,0.5,-1.5); glVertex3f( 0.5,0.5,-0.5); glEnd(); But this produces a blank screen! What am I doing wrong? Is there some debug mode where I can print out the transformed vertices, so I can see where they are ending up? Note: People have suggested that using glMultMatrixf() might make a difference. It doesn't. Replacing glLoadMatrixf( shadow ); with glLoadIdentity(); glMultMatrixf( shadow ); gives the identical result ( of course! )

    Read the article

  • Intersection points of plane set forming convex hull

    - by Toji
    Mostly looking for a nudge in the right direction here. Given a set of planes (defined as a normal and distance from origin) that form a convex hull, I would like to find the intersection points that form the corners of that hull. More directly, I'm looking for a way to generate a point cloud appropriate to provide to Bullet. Bonus points if someone knows of a way I could give bullet the plane list directly, since I somewhat suspect that's what it's building on the backend anyway.

    Read the article

  • Ray-plane intersection to find the Z of the intersecting point

    - by Jenko
    I have a rectangle in 3d space (p1, p2, p3, p4) and when the mouse rolls over it I need to calculate the exact Z of the point on the rect, given the mouse coordinates (x, y). Would a Ray-plane intersection find the Z of the intersecting point? Edit: Would this one-liner work? .. it returns the t value for the intersection, apparently the Z value. float rayPlane(vector3D planepoint, vector3D normal, vector3D origin, vector3D direction){ return -((origin-planepoint).dot(normal))/(direction.dot(normal)); }

    Read the article

  • Passengers Push A Plane Half A Mile In China After Landing

    - by Gopinath
    In India, I have seen passengers pushing busses and cars when the vehicles break down in the mid of road. But never heard anything like this – a passenger flight in china had to be pushed half a mile by the  passengers and airport authorities after landing.   Chinese Shandong Airlines Flight arrived safely at Zhengzhou airport safely and broke down just before reaching the passenger terminal.  The 20 ton flight was pushed by staff and few passengers half a mile to clear the run way! via dailymail This article titled,Passengers Push A Plane Half A Mile In China After Landing, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Getting velocity in only one plane (X) in Kismet (UDK)

    - by anna1987
    I'm trying to make a character in 2.5 platformer (in UDK) to "climb" a giant tree trunk by walking on a spiral staircase enveloped around the tree. When character goes right the tree rotates thru matinee sequence so it seems that the character is moving while in reality it is the tree that moves. I connected the matinee sequence playrate to the velocity of the character and its all good as long the character just moves left or right. When it jumps though, the velocity still affects the playrate - it should not as character moves up/down, not right/left. How do I set it up in Kismet so I get a float variable with velocity only in the X plane (horizontal)?

    Read the article

  • Future Air Plane – A new world

    - by Rekha
    For the first time in my life, I wished I had more number of years to live. The world has evolved from the cave man life to the man who is almost The Creator. When I was about 12 years old, I was taken to Chennai Planetarium for my school excursion. That day we were made to lie down in a dark room and the ceiling was full of stars and planets. All those were just videos but the day still stands in my mind. Same kind of experience in real is waiting for our future generations.Even though the English movies have gone beyond imaginations, we still have chances to bring those imaginations to real. You must be wondering why all these hype. Recently Airbus unveiled a news on transparent Airplane in 2050. This Airplane will have a body transparent to view the sky from all sides of the airplane when we are flying high above the grounds. And it will have all possible technologies under one roof that would give immense pleasure for the passengers. The journey would be an unforgettable one for each one of us. Image and News Credit: Daily Telegraph This article titled,Future Air Plane – A new world, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Clean MVC design when there is viewer latency

    - by Tony Suffolk 66
    It isn't clear if this question has already been answered, so apologies in advance if this is a duplicate : I am implementing a game and trying to design around a clean MVC pattern - so my Control plane will implement the rules of the game (but not how the game is displayed), and the View plane implements how the game is displayed, and user iteraction - i.e. what game items or controls the user has activated. The challenge that I have is this : In my game the Control Plane can move game items more or less instaneously (The decision about what item to place where - and some of the initial consequences of that placement are reasonably trivial to calculate), but I want to design the Control Plane so that the View plane can display these movements either instaneously or using movement animations. The other complication is that player interaction must be locked out while those game items are moving (similar to chess - you can't attack an opposing piece as it moves past one of your pieces) So do I : Implement all the logic in the Control Plane asynchronously - and separate the descision making from the actions - so the Control plane decides piece 'A' needs to move to a given place - tells the view plane, and but does not implement the move in data until the view plane informs the control plane that the move/animation is complete. A lot of interlock points between the two layers. Implement all the control plane logic in one place - decisions and movement (keeping track of what moved where), and pass all the movements in one go to the View plane to do with what it will. Control Plane is almost fire and forget here. A hybrid of 1 & 2 - The control plane implements all the moves in a temporary data store - but maintains a second store which reflects what is actually visible to the viewer, based on calls and feedback from the View plane. All 3 are relatively easy to implement (target language is python), but having never done a clean MVC pattern with view latency before - I am not sure which design is best

    Read the article

  • 3D coordinate of 2D point given camera and view plane

    - by Myx
    I wish to generate rays from the camera through the viewing plane. In order to do this, I need my camera position ("eye"), the up, right, and towards vectors (where towards is the vector from the camera in the direction of the object that the camera is looking at) and P, the point on the viewing plane. Once I have these, the ray that's generated is: ray = camera_eye + t*(P-camera_eye); where t is the distance along the ray (assume t = 1 for now). My question is, how do I obtain the 3D coordinates of point P given that it is located at position (i,j) on the viewing plane? Assume that the upper left and lower right corners of the viewing plane are given. NOTE: The viewing plane is not actually a plane in the sense that it doesn't extend infinitely in all directions. Rather, one may think of this plane as a widthxheight image. In the x direction, the range is 0--width and in the y direction the range is 0--height. I wish to find the 3D coordinate of the (i,j)th element, 0

    Read the article

  • Real life usage of the projective plane theory

    - by Elazar Leibovich
    I'm learning about the theory of the projective plane. Very generally speaking, it is an extension of the plane, which includes additional points which are defined as the intersection points of two parallel lines. In the projective plane, every two lines have an interesection point. Whether they're parallel or not. Every point in the projective plane can be represented by three numbers (you actually need less than that, but nevemind now). Is there any real life application which uses the projective plane? I can think that, for instance, a software which needs to find the intersections of a line, can benefit from always having an intersection point which might lead to simpler code, but is it really used?

    Read the article

  • 2D map/plane with nodes overlayed that supports panning, scaling and clicking on nodes

    - by garlicman
    I'm trying my hand at Android development and seem to be running into an invisible ceiling in trying to get what I want accomplished. Basically I'm trying to create an app that renders a 2D surface map that I can (pinch) zoom and pan. I'll have to place nodes on the surface of the map that will scale/zoom and pan in relation to the surface. I started out with a 2D ImageView approach and got as far as pinch zoom, pan and laying nodes as relative ImageViews, but all the methods I tried to get X,Y,W,H for the 2D surface were always off for some reason. Additionally, I was never able to scale the node ImageViews correctly, and as a result never got far enough to try and work out their X,Y scaled offset. So I decided to get back to 3D rendering. Conceptually pan/zoom is camera manipulation, so I don't have to mess with how to scale the 2D map or the nodes. But I need a starting point or sample to get me going that's close to what I'm trying to achieve. A sample on a translucent spinning cube isn't helping as much as I need it to. Any tips? Links, insults and sympathy are all welcome!

    Read the article

  • X-Plane Flight Sim in Ubuntu 10.04 64bit

    <b>RWDub's Reviews:</b> "After installing Ubuntu 10.04, I realized that I was going to really miss my flying games. In an attempt to passify myself I downloaded and installed FlightGear, which is entirely free and I must admit it is pretty incredible."

    Read the article

  • XNA clip plane effect makes models black

    - by user1990950
    When using this effect file: float4x4 World; float4x4 View; float4x4 Projection; float4 ClipPlane0; void vs(inout float4 position : POSITION0, out float4 clipDistances : TEXCOORD0) { clipDistances.x = dot(position, ClipPlane0); clipDistances.y = 0; clipDistances.z = 0; clipDistances.w = 0; position = mul(mul(mul(position, World), View), Projection); } float4 ps(float4 clipDistances : TEXCOORD0) : COLOR0 { clip(clipDistances); return float4(0, 0, 0, 0); } technique { pass { VertexShader = compile vs_2_0 vs(); PixelShader = compile ps_2_0 ps(); } } all models using this are rendered black. Is it possible to render them correctly?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >