Search Results

Search found 3121 results on 125 pages for 'resolution independence'.

Page 20/125 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Black screen after grub kernal selection menu

    - by skip
    I have an Acer eMachines e727 with Intel GMA 4500M integrated graphics (drivers updated to latest). I installed Ubuntu 12.04 using Wubi. All is well until I select the kernal (first one on the list). My display goes black. I searched for solutions and found one on Unbuntu forum which partially helped. Following that sticky post, I pressed "e" at the kernal listings. I changed the $Linux... default line to "quiet splash nomodeset" and was able to get to the login screen and desktop. I edited grub to make the nomodeset permanent (also removed the vt command as recommended). I followed through with changing grub to match the graphics as recommended in the article using the grub cli (using info from vbeinfo). I updated grub with the recommended settings but still get the black screen after selecting the kernal. Only nomodeset works to get me to the login and desktop. Once I get to the desktop, my display resolution shows being set to 1024x768 but it actually looks like 800x680. What do I need to do to get past these issues? Thanks!

    Read the article

  • Getting an OBB out of another OBB?

    - by Milo
    I'm working on collision resolution for my game. I just need a good way to get an object out of another object if it gets stuck. In this case a car. Here is a typical scenario. The red car is in the green object. How do I correctly get it out so the car can slide along the edge of the object as it should. I tried: if(buildings.size() > 0) { Entity e = buildings.get(0); Vector2D vel = new Vector2D(); vel.x = vehicle.getVelocity().x; vel.y = vehicle.getVelocity().y; vel.normalize(); while(vehicle.getRect().overlaps(e.getRect())) { vehicle.setCenter(vehicle.getCenterX() - vel.x * 0.1f, vehicle.getCenterY() - vel.y * 0.1f); } colided = true; } But that does not work too well. Is there some sort of vector I could calculate to use as the vector to move the car away from the object? Thanks

    Read the article

  • 2D Rectangle Collision Response with Multiple Rectangles

    - by Justin Skiles
    Similar to: Collision rectangle response I have a level made up of tiles where the edges of the level are made up of collidable rectangles. The player's collision box is represented by a rectangle as well. The player can move in 8 directions. The player's velocity is equal in X and Y directions and constant. Each update, I am checking the player's collision against all tiles that are a certain distance away. When the player collides with a rectangle, I am finding the intersection depth and resolving along the most shallow axis followed by the other axis. This resolution happens for both axes simultaneously. See below for two examples of situations where I am having trouble. Moving up-left against the left wall In the scenario below, the player is colliding with two tiles. The tile intersection depth is equal on both axes for the top tile and more shallow in the X axis for the middle tile. Because the player is moving up the wall, the player should slide in an upward direction along the wall. This works properly as long as the rectangle with the more shallow depth is evaluated first. If the equal intersection depth rectangle is evaluated first, there is a chance the player becomes stuck. Moving up-left against the top wall Here is an identical scenario with the exception that the collision is with the top wall. The same problem occurs at the corners when intersection depth is equal for both axes. I guess my overall question is: How can I ensure that collision response occurs on tiles that have non-equal intersection depth before tiles that have equal intersection depth in order to get around the weirdness that occurs at these corners. Sean's answer in the linked question was good, but his solution required having different velocity components in a certain direction. My situation has equal velocities, so there's no good way to tell which direction to resolve at corners. I hope I have made my explanation clear.

    Read the article

  • Confusion with floats converted into ints during collision detection

    - by TheBroodian
    So in designing a 2D platformer, I decided that I should be using a Vector2 to track the world location of my world objects to retain some sub-pixel precision for slow-moving objects and other such subtle nuances, yet representing their bodies with Rectangles, because as far as collision detection and resolution is concerned, I don't need sub-pixel precision. I thought that the following line of thought would work smoothly... Vector2 wrldLocation; Point WorldLocation; Rectangle collisionRectangle; public void Update(GameTime gameTime) { Vector2 moveAmount = velocity * (float)gameTime.ElapsedGameTime.TotalSeconds wrldLocation += moveAmount; WorldLocation = new Point((int)wrldLocation.X, (int)wrldLocation.Y); collisionRectangle = new Rectangle(WorldLocation.X, WorldLocation.Y, genericWidth, genericHeight); } and I guess in theory it sort of works, until I try to use it in conjunction with my collision detection, which works by using Rectangle.Offset() to project where collisionRectangle would supposedly end up after applying moveAmount to it, and if a collision is found, finding the intersection and subtracting the difference between the two intersecting sides to the given moveAmount, which would theoretically give a corrected moveAmount to apply to the object's world location that would prevent it from passing through walls and such. The issue here is that Rectangle.Offset() only accepts ints, and so I'm not really receiving an accurate adjustment to moveAmount for a Vector2. If I leave out wrldLocation from my previous example, and just use WorldLocation to keep track of my object's location, everything works smoothly, but then obviously if my object is being given velocities less than 1 pixel per update, then the velocity value may as well be 0, which I feel further down the line I may regret. Does anybody have any suggestions about how I might go about resolving this?

    Read the article

  • Restart and/or graphics problem in Ubuntu 12.04

    - by kara
    I having been using 12.04 for a couple of months now, with v. little problems. The other day I restarted my computer, and though I think it rebooted, the screen would be black. I could not even get a visual from a live cd. Finally, I was able to get it to load, but the resolution has been completely off. The computer thinks I have a laptop screen, when I actually have a ViewSonic VP2330wb, and it detects only two resolutions. And still, I have a problem with rebooting. If the screen locks after I leave it for a while, I can't get a visual back, and then when I force a shutdown, it takes 3 times for me to get a grub screen. Then I have to boot in recovery mode, and then finally in normal mode, but the screen is still always off. This is my video card: description: VGA compatible controller product: 2nd Generation Core Processor Family Integrated Graphics Controller vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 09 width: 64 bits clock: 33MHz capabilities: msi pm vga_controller bus_master cap_list configuration: latency=0 resources: memory:fe000000-fe3fffff memory:d0000000-dfffffff ioport:f000(size=64) I am a new ubuntu user, and am at my wits end. Any help would be greatly appreciated.

    Read the article

  • How do 2D physics engines solve the problem of resolving collisions along tiled walls/floors in non-grid-based worlds?

    - by ssb
    I've been working on implementing my SAT algorithm which has been coming along well, but I've found that I'm at a wall when it comes to its actual use. There are plenty of questions regarding this issue on this site, but most of them either have no clear, good answer or have a solution based on checking grid positions. To restate the problem that I and many others are having, if you have a tiled surface, like a wall or a floor, consisting of several smaller component rectangles, and you traverse along them with another rectangle with force being applied into that structure, there are cases where the object gets caught on a false collision on an edge that faces the inside of the shape. I have spent a lot of time thinking about how I could possibly solve this without having to resort to a grid-based system, and I realized that physics engines do this properly. What I want to know is how they do this. What do physics engines do beyond basic SAT that allows this kind of proper collision resolution in complex environments? I've been looking through the source code to Box2D trying to find out how they do it but it's not quite as easy as looking at a Collision() method. I think I'm not good enough at physics to know what they're doing mathematically and not good enough at programming to know what they're doing programmatically. This is what I aim to fix.

    Read the article

  • Problems with dual monitor & resolutions, only in 14.04

    - by theLadder
    I installed Ubuntu 14.04 but i am having weird problems with my dual monitors and the resolutions. I also tried Xubuntu 14.04 and was having the same problem. I have one 32 inch LG TV with 1920x1080 and one monitor with 1280x1024 resolution. When i first start my 32 inch gets 1360x768, if i then try to change to 1920x1080, everythings looks fine and the prompt asking me if i want to keep settings comes up and starts the countdown, but after 2 seconds my computer freezes, and after a few more seconds it reboots itself. However, if i disable my smaller monitor first, i can change to 1920x1080 on my 32 inch without problems, but if i then activate the second monitor the same problem happens again. in Xubuntu 14.04 i can change the refresh rate, if i run the 32 inch at 30hz or 50hz everytying works, but i would like to be able to run it at 60hz. I'm currently running Xubuntu 13.10 without this problem. My graphics card is a ATI Radeon HD 4850. What is causing this problem, grahpics drivers? Kernel? Xorg? And how do i solve it?

    Read the article

  • Monitor dectecs wrong display mode

    - by user292449
    I am running into an issue with 14.04. I have two monitors. the fist one is a 19 inch LG that runs off DVI at 1440x900. It seems to function just fine. The second is a 23 inch LG that should run at 1920x1200. It has been plugged in with both a HDMI to HDMI cable and a DVI to HDMI cable. It seems to be stuck in "I am displaying for a DVD player in 1080p mode" or some such. I had this issue with windows a long long time ago and eventually it just went away. I can set the screen display to 1920x1200 with the generic X drivers but I am a gamer and would like to use the Nvidia drivers since they deliver better performance. When I switch to the Nvidia driver I can set the resolution to 1920x1200 but the screen seems to be up and to the left with a black border down and to the right. If I switch back to the default X driver after this the screen remains stuck in the up and to the left mode. Any help would be wonderful.

    Read the article

  • LG W3000H-BN monitor cannot go above 1280x800

    - by Jo Profit
    I noticed that there are many people complaining about this issue with the W3000H but I have yet to find a solution that works for me. I am using Windows 7 Professional and and using a nVidia Quadro NVS 240 video card with a 4 monitor splitter cable. The cable from the monitor and the splitter are rated DVI-D Dual Link and the video card itself is rated for 2560x1600. I have installed the latest drivers for the video card and just grabbed the .inf, icm and cat file from the LG website and manually installed the monitor drivers. Does anyone have problems with the same setup? I have 3 other monitors (2 at 1920x1080 and 1 at 1280x1024). I really would like to be able to display the full resolution or else the large screen is useless. (I triple checked that the monitor itself supports this resolution). So monitor, cable, splitter and card supposedly support 2560x1600. Drivers are up to date but I cannot select that resolution when in the "Screen Resolution" menu, nor through the nVidia control panel. Please save me from madness :)

    Read the article

  • Monitor reset itself and now I can't set the resolution/settings back to how it was before

    - by verve
    I've had my LG 24" widescreen monitor since 2009 and 2 weeks ago I noticed the monitor turned itself off (never had it done this before) so I switched it back on to find all the settings like gamma, resolution etc. different = looked like it had been reset. Everyone in the house swears they never unplugged and plugged it back in. When I opened a webpage the fonts and zoom on the pages were different and my desktop was strange too; fonts of the icons were different etc. The screen seems blurry and when I watch movies the faces look distorted so I thought I would try to first figure out the resolution it used to be but when I go under "Adjust screen resolution" none of the options work and there is no recommended resolution marked; all the options stretch out the screen and looks terrible so right now I have it set to the least distorted one. Then since the resolution wasn't working I set the other manual settings(done by physical buttons on the monitor) back to how it used to be (luckily, I had written these down). The monitor looks better but the resolution makes it a strain to use. I thought maybe some Windows update caused this crap so I tried to System Restore: didn't work. What went wrong? A few questions: 1) What was the likely cause of the monitor shutting down itself and screwing up the settings I have been using since the day I bought the monitor? 2) Why have the fonts changed everywhere unless this is a HDD/video card problem? 3) How do I find the perfect resolution it used to be? The monitor wants me to set it to 1920 x 1080 but that isn't one of the options although I don't remember what resolution I used before. I use the 16:9 setting while I try the available resolution options but nothing looks good! How do I find what it used to be? Manual available in PDF under Support: http://www.lg.com/ca_en/computer-products/monitors/LG-lcd-monitor-W2442PA-BF.jsp Win 7. IE 9.

    Read the article

  • Remote Desktop Zooming

    - by codeulike
    Using Remote Desktop from a device with a hi-res screen (say, a Surface Pro) is decidedly tricky - as everything displays 1:1 scale and so looks tiny. If the machine you are remoting into runs Server 2008 R2 or later, you can change the dpi zooming setting (see here). But for older hosts, that doesn't work. Using normal Remote Desktop, you can connect with a lower resolution, say 1280x768, and turn on smart-sizing. However smart-sizing can scale down (to display a huge desktop in a small area) but does not seem to scale up (to display a small desktop in a big area). Using the Windows 8 Remote Desktop App, you can zoom - but you cannot set the default resolution of the host. What I want is a lower resolution in the host, scaled up to fit my screen. So both of those are close to what I want, but dont quite work. So question is: Does the Remote Desktop App allow screen resolution to be set somehow? Is there some other Remote Desktop client that can handle zooming better?

    Read the article

  • Windows 7 Stopped Using hosts file for DNS Resolution

    - by AJ
    I am running Windows 7 Home Premium 64-bit. Starting today, I noticed that DNS resolution is not reading my %SYSTEMROOT%\System32\drivers\etc\hosts file. I say this because I added two new entries to the file and when I run 'nslookup' on the command line, they don't resolve. Further, just trying to resolve 'localhost' results in my primary DNS server being queried. I've read several threads that suggest that the file might have been corrupted and to move it aside and create a new one. I've done that, and no improvement. Is there some sort of registry key that controls the sequence of resources used for DNS resolution (similar to nsswitch.conf on UNIX)? What else could be causing this? Thanks in advance.

    Read the article

  • How can I get 2560 * 1600 on Win 7 ? MacBook Pro 17 + Dell 30 inch 3008 WFP + Fusion 3

    - by Tarek Demiati
    I run VM Ware Fusion 3 on a Mac Book Pro 17 hooked to a Dell 30 inch screen I CAN manage to get a Resolution of 2560 * 1600 on Mac OS X(MacBook Pro), but can't on Win 7 (on the exact same MacBook Pro) The highest resolution I can get on MS Win 7 is 2048 * 1536 (and I want to be able to set it to 2560 * 1600 to fully enjoy the real estate of my 30 inch screen!) I have searched the KB, and found an article which mentionned that I should add the following lines in the vmx file (which I did) The lines are the very bottom of the vmx file svga.maxWidth = "2560" svga.maxHeight = "1600" svga.vramSize = "16384000" KB Article : http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1003&sliceId=1&docTypeID=DT_KB_1_1&dialogID=63746028&stateId=0%200%2066741566 I did the manipulation describe in the KB above however, I rebooted several times, but I still can't get the correct resolution to show in Windows

    Read the article

  • ubuntu 10.04 console resolution

    - by Ove
    I have installed Ubuntu 10.04 on my HP Pavilion dv6000 After I installed it, the text in the console (when I press ALT+F1) was small and the console had a good resolution (I think the same as my LCD, 1280x800). Also, at boot, the "Ubuntu" logo was small and centered in the middle of the screen. That was good. After that, I installed the nVidia driver via the "System-Administration-Hardware drivers" screen. After the driver was installed, the text in the console was larger and more pixelated, and also the "Ubuntu" logo was much larger and looked uglier because it was pixelated. Can anyone help me change the resolution in the console and boot screen back to what it was before I installed the nVidia driver?

    Read the article

  • Dock displays low-resolution icons

    - by squircle
    Recently, I've noticed that the dock has been starting to display low-resolution icons in place of the former high-resolution icons for common apps like Stickies, Word, iTunes and Preview. Looking at the .icns file within each program, all copies of the icon are present within the file (high and low resolutions), but the dock refuses to display them, leaving some programs looking like this: Restarting doesn't stop this behaviour, nor does a killall Dock, nor removing the icon and replacing it in the dock. In Finder, the icons display normally. Does anybody know what may be causing this issue? Thanks!

    Read the article

  • Ubuntu 10.10: getting appropiate monitor resolution for lcd hdtv

    - by lurscher
    I'm running Ubuntu 10.10 x86_64 version, with Nvidia 9800 GT, installed 270.41.06 Nvidia drivers following this guide. I have a LG42LH30FR LCD TV connected with the dvi link - RGB PC input I'm able to get 1024x768 resolution without overscan (I can get 1080i = 1366x768 but there is a lot of hidden screen space to the right and I don't know what to do about it). I want to get full HD I can get full HD (1080p = 1920x1080) on Windows XP 64-bit with custom resolution created with Nvidia Control Panel, from reading over xorg.conf configurations it seems I need to add a certain modeling to the monitor configuration, but I don't know where to get the appropriate options for this task any suggestions?

    Read the article

  • Monitor "forgot" its native resolution overnight

    - by Ben
    I have: Hanns G HW173A monitor NVIDIA GTX 460 graphics card Windows XP SP3. It was working. Suddenly overnight I can no longer use my monitor's native resolution of 1440x900. It's not listed, and if I force it it only shows part of the screen. The only resolution that seems to fit the whole screen is now 1024x768. I have tried reinstalling the NVIDIA drivers as well as disabling and enabling the monitor drivers (for windows XP the monitor uses the microsoft "default monitor" drivers - this is what Hanns G says on their website too). Any ideas? Thanks very much.

    Read the article

  • Resolution of monitor is not supported by motherboard

    - by Sandesh
    I have Desktop with configuration Pentium 4,945 intel chipset board,dual booting with win 7 and ubuntu 10.10 (no graphics card) Recently i purchased Dell IN2020M 20" with native resolution of 1600x900 but my display allow maximum of 1024x768 because of this when i play any video in full screen mode it doesn't play smoothly or frames are refreshed jerkily I have tried updating my VGA driver but its doesn't helping me much. Is there any way to solve this problem ? 1if i want to replace monitor what maximum resolution should i buy ? 2if i want to upgrade(graphics card/motherboard) my desktop what is the minimum configuration to support the current system. Thanks in advance

    Read the article

  • Opposite Force to Apply to a Collided Rigid Body?

    - by Milo
    I'm working on the physics for my GTA2-like game so I can learn more about game physics. The collision detection and resolution are working great. I'm now just unsure how to compute the force to apply to a body after it collides with a wall. My rigid body looks like this: /our simulation object class RigidBody extends Entity { //linear private Vector2D velocity = new Vector2D(); private Vector2D forces = new Vector2D(); private float mass; private Vector2D v = new Vector2D(); //angular private float angularVelocity; private float torque; private float inertia; //graphical private Vector2D halfSize = new Vector2D(); private Bitmap image; private Matrix mat = new Matrix(); private float[] Vector2Ds = new float[2]; private Vector2D tangent = new Vector2D(); private static Vector2D worldRelVec = new Vector2D(); private static Vector2D relWorldVec = new Vector2D(); private static Vector2D pointVelVec = new Vector2D(); private static Vector2D acceleration = new Vector2D(); public RigidBody() { //set these defaults so we don't get divide by zeros mass = 1.0f; inertia = 1.0f; setLayer(LAYER_OBJECTS); } protected void rectChanged() { if(getWorld() != null) { getWorld().updateDynamic(this); } } //intialize out parameters public void initialize(Vector2D halfSize, float mass, Bitmap bitmap) { //store physical parameters this.halfSize = halfSize; this.mass = mass; image = bitmap; inertia = (1.0f / 20.0f) * (halfSize.x * halfSize.x) * (halfSize.y * halfSize.y) * mass; RectF rect = new RectF(); float scalar = 10.0f; rect.left = (int)-halfSize.x * scalar; rect.top = (int)-halfSize.y * scalar; rect.right = rect.left + (int)(halfSize.x * 2.0f * scalar); rect.bottom = rect.top + (int)(halfSize.y * 2.0f * scalar); setRect(rect); } public void setLocation(Vector2D position, float angle) { getRect().set(position.x,position.y, getWidth(), getHeight(), angle); rectChanged(); } public Vector2D getPosition() { return getRect().getCenter(); } @Override public void update(float timeStep) { doUpdate(timeStep); } public void doUpdate(float timeStep) { //integrate physics //linear acceleration.x = forces.x / mass; acceleration.y = forces.y / mass; velocity.x += (acceleration.x * timeStep); velocity.y += (acceleration.y * timeStep); //velocity = Vector2D.add(velocity, Vector2D.scalarMultiply(acceleration, timeStep)); Vector2D c = getRect().getCenter(); v.x = getRect().getCenter().getX() + (velocity.x * timeStep); v.y = getRect().getCenter().getY() + (velocity.y * timeStep); setCenter(v.x, v.y); forces.x = 0; //clear forces forces.y = 0; //angular float angAcc = torque / inertia; angularVelocity += angAcc * timeStep; setAngle(getAngle() + angularVelocity * timeStep); torque = 0; //clear torque } //take a relative Vector2D and make it a world Vector2D public Vector2D relativeToWorld(Vector2D relative) { mat.reset(); Vector2Ds[0] = relative.x; Vector2Ds[1] = relative.y; mat.postRotate(JMath.radToDeg(getAngle())); mat.mapVectors(Vector2Ds); relWorldVec.x = Vector2Ds[0]; relWorldVec.y = Vector2Ds[1]; return relWorldVec; } //take a world Vector2D and make it a relative Vector2D public Vector2D worldToRelative(Vector2D world) { mat.reset(); Vector2Ds[0] = world.x; Vector2Ds[1] = world.y; mat.postRotate(JMath.radToDeg(-getAngle())); mat.mapVectors(Vector2Ds); worldRelVec.x = Vector2Ds[0]; worldRelVec.y = Vector2Ds[1]; return worldRelVec; } //velocity of a point on body public Vector2D pointVelocity(Vector2D worldOffset) { tangent.x = -worldOffset.y; tangent.y = worldOffset.x; pointVelVec.x = (tangent.x * angularVelocity) + velocity.x; pointVelVec.y = (tangent.y * angularVelocity) + velocity.y; return pointVelVec; } public void applyForce(Vector2D worldForce, Vector2D worldOffset) { //add linear force forces.x += worldForce.x; forces.y += worldForce.y; //add associated torque torque += Vector2D.cross(worldOffset, worldForce); } @Override public void draw( GraphicsContext c) { c.drawRotatedScaledBitmap(image, getPosition().x, getPosition().y, getWidth(), getHeight(), getAngle()); } public Vector2D getVelocity() { return velocity; } public void setVelocity(Vector2D velocity) { this.velocity = velocity; } } The way it is given force is by the applyForce method, this method considers angular torque. I'm just not sure how to come up with the vectors in the case where: RigidBody hits static entity RigidBody hits other RigidBody that may or may not be in motion. Would anyone know a way (without too complex math) that I could figure out the opposite force I need to apply to the car? I know the normal it is colliding with and how deep it collided. My main goal is so that say I hit a building from the side, well the car should not just stay there, it should slowly rotate out of it if I'm more than 45 degrees. Right now when I hit a wall I only change the velocity directly which does not consider angular force. Thanks!

    Read the article

  • How can I get penetration depth from Minkowski Portal Refinement / Xenocollide?

    - by Raven Dreamer
    I recently got an implementation of Minkowski Portal Refinement (MPR) successfully detecting collision. Even better, my implementation returns a good estimate (local minimum) direction for the minimum penetration depth. So I took a stab at adjusting the algorithm to return the penetration depth in an arbitrary direction, and was modestly successful - my altered method works splendidly for face-edge collision resolution! What it doesn't currently do, is correctly provide the minimum penetration depth for edge-edge scenarios, such as the case on the right: What I perceive to be happening, is that my current method returns the minimum penetration depth to the nearest vertex - which works fine when the collision is actually occurring on the plane of that vertex, but not when the collision happens along an edge. Is there a way I can alter my method to return the penetration depth to the point of collision, rather than the nearest vertex? Here's the method that's supposed to return the minimum penetration distance along a specific direction: public static Vector3 CalcMinDistance(List<Vector3> shape1, List<Vector3> shape2, Vector3 dir) { //holding variables Vector3 n = Vector3.zero; Vector3 swap = Vector3.zero; // v0 = center of Minkowski sum v0 = Vector3.zero; // Avoid case where centers overlap -- any direction is fine in this case //if (v0 == Vector3.zero) return Vector3.zero; //always pass in a valid direction. // v1 = support in direction of origin n = -dir; //get the differnce of the minkowski sum Vector3 v11 = GetSupport(shape1, -n); Vector3 v12 = GetSupport(shape2, n); v1 = v12 - v11; //if the support point is not in the direction of the origin if (v1.Dot(n) <= 0) { //Debug.Log("Could find no points this direction"); return Vector3.zero; } // v2 - support perpendicular to v1,v0 n = v1.Cross(v0); if (n == Vector3.zero) { //v1 and v0 are parallel, which means //the direction leads directly to an endpoint n = v1 - v0; //shortest distance is just n //Debug.Log("2 point return"); return n; } //get the new support point Vector3 v21 = GetSupport(shape1, -n); Vector3 v22 = GetSupport(shape2, n); v2 = v22 - v21; if (v2.Dot(n) <= 0) { //can't reach the origin in this direction, ergo, no collision //Debug.Log("Could not reach edge?"); return Vector2.zero; } // Determine whether origin is on + or - side of plane (v1,v0,v2) //tests linesegments v0v1 and v0v2 n = (v1 - v0).Cross(v2 - v0); float dist = n.Dot(v0); // If the origin is on the - side of the plane, reverse the direction of the plane if (dist > 0) { //swap the winding order of v1 and v2 swap = v1; v1 = v2; v2 = swap; //swap the winding order of v11 and v12 swap = v12; v12 = v11; v11 = swap; //swap the winding order of v11 and v12 swap = v22; v22 = v21; v21 = swap; //and swap the plane normal n = -n; } /// // Phase One: Identify a portal while (true) { // Obtain the support point in a direction perpendicular to the existing plane // Note: This point is guaranteed to lie off the plane Vector3 v31 = GetSupport(shape1, -n); Vector3 v32 = GetSupport(shape2, n); v3 = v32 - v31; if (v3.Dot(n) <= 0) { //can't enclose the origin within our tetrahedron //Debug.Log("Could not reach edge after portal?"); return Vector3.zero; } // If origin is outside (v1,v0,v3), then eliminate v2 and loop if (v1.Cross(v3).Dot(v0) < 0) { //failed to enclose the origin, adjust points; v2 = v3; v21 = v31; v22 = v32; n = (v1 - v0).Cross(v3 - v0); continue; } // If origin is outside (v3,v0,v2), then eliminate v1 and loop if (v3.Cross(v2).Dot(v0) < 0) { //failed to enclose the origin, adjust points; v1 = v3; v11 = v31; v12 = v32; n = (v3 - v0).Cross(v2 - v0); continue; } bool hit = false; /// // Phase Two: Refine the portal int phase2 = 0; // We are now inside of a wedge... while (phase2 < 20) { phase2++; // Compute normal of the wedge face n = (v2 - v1).Cross(v3 - v1); n.Normalize(); // Compute distance from origin to wedge face float d = n.Dot(v1); // If the origin is inside the wedge, we have a hit if (d > 0 ) { //Debug.Log("Do plane test here"); float T = n.Dot(v2) / n.Dot(dir); Vector3 pointInPlane = (dir * T); return pointInPlane; } // Find the support point in the direction of the wedge face Vector3 v41 = GetSupport(shape1, -n); Vector3 v42 = GetSupport(shape2, n); v4 = v42 - v41; float delta = (v4 - v3).Dot(n); float separation = -(v4.Dot(n)); if (delta <= kCollideEpsilon || separation >= 0) { //Debug.Log("Non-convergance detected"); //Debug.Log("Do plane test here"); return Vector3.zero; } // Compute the tetrahedron dividing face (v4,v0,v1) float d1 = v4.Cross(v1).Dot(v0); // Compute the tetrahedron dividing face (v4,v0,v2) float d2 = v4.Cross(v2).Dot(v0); // Compute the tetrahedron dividing face (v4,v0,v3) float d3 = v4.Cross(v3).Dot(v0); if (d1 < 0) { if (d2 < 0) { // Inside d1 & inside d2 ==> eliminate v1 v1 = v4; v11 = v41; v12 = v42; } else { // Inside d1 & outside d2 ==> eliminate v3 v3 = v4; v31 = v41; v32 = v42; } } else { if (d3 < 0) { // Outside d1 & inside d3 ==> eliminate v2 v2 = v4; v21 = v41; v22 = v42; } else { // Outside d1 & outside d3 ==> eliminate v1 v1 = v4; v11 = v41; v12 = v42; } } } return Vector3.zero; } }

    Read the article

  • Move penetrating OBB out of another OBB to resolve collision

    - by Milo
    I'm working on collision resolution for my game. I just need a good way to get an object out of another object if it gets stuck. In this case a car. Here is a typical scenario. The red car is in the green object. How do I correctly get it out so the car can slide along the edge of the object as it should. I tried: if(buildings.size() > 0) { Entity e = buildings.get(0); Vector2D vel = new Vector2D(); vel.x = vehicle.getVelocity().x; vel.y = vehicle.getVelocity().y; vel.normalize(); while(vehicle.getRect().overlaps(e.getRect())) { vehicle.setCenter(vehicle.getCenterX() - vel.x * 0.1f, vehicle.getCenterY() - vel.y * 0.1f); } colided = true; } But that does not work too well. Is there some sort of vector I could calculate to use as the vector to move the car away from the object? Thanks Here is my OBB2D class: public class OBB2D { // Corners of the box, where 0 is the lower left. private Vector2D corner[] = new Vector2D[4]; private Vector2D center = new Vector2D(); private Vector2D extents = new Vector2D(); private RectF boundingRect = new RectF(); private float angle; //Two edges of the box extended away from corner[0]. private Vector2D axis[] = new Vector2D[2]; private double origin[] = new double[2]; public OBB2D(Vector2D center, float w, float h, float angle) { set(center,w,h,angle); } public OBB2D(float left, float top, float width, float height) { set(new Vector2D(left + (width / 2), top + (height / 2)),width,height,0.0f); } public void set(Vector2D center,float w, float h,float angle) { Vector2D X = new Vector2D( (float)Math.cos(angle), (float)Math.sin(angle)); Vector2D Y = new Vector2D((float)-Math.sin(angle), (float)Math.cos(angle)); X = X.multiply( w / 2); Y = Y.multiply( h / 2); corner[0] = center.subtract(X).subtract(Y); corner[1] = center.add(X).subtract(Y); corner[2] = center.add(X).add(Y); corner[3] = center.subtract(X).add(Y); computeAxes(); extents.x = w / 2; extents.y = h / 2; computeDimensions(center,angle); } private void computeDimensions(Vector2D center,float angle) { this.center.x = center.x; this.center.y = center.y; this.angle = angle; boundingRect.left = Math.min(Math.min(corner[0].x, corner[3].x), Math.min(corner[1].x, corner[2].x)); boundingRect.top = Math.min(Math.min(corner[0].y, corner[1].y),Math.min(corner[2].y, corner[3].y)); boundingRect.right = Math.max(Math.max(corner[1].x, corner[2].x), Math.max(corner[0].x, corner[3].x)); boundingRect.bottom = Math.max(Math.max(corner[2].y, corner[3].y),Math.max(corner[0].y, corner[1].y)); } public void set(RectF rect) { set(new Vector2D(rect.centerX(),rect.centerY()),rect.width(),rect.height(),0.0f); } // Returns true if other overlaps one dimension of this. private boolean overlaps1Way(OBB2D other) { for (int a = 0; a < axis.length; ++a) { double t = other.corner[0].dot(axis[a]); // Find the extent of box 2 on axis a double tMin = t; double tMax = t; for (int c = 1; c < corner.length; ++c) { t = other.corner[c].dot(axis[a]); if (t < tMin) { tMin = t; } else if (t > tMax) { tMax = t; } } // We have to subtract off the origin // See if [tMin, tMax] intersects [0, 1] if ((tMin > 1 + origin[a]) || (tMax < origin[a])) { // There was no intersection along this dimension; // the boxes cannot possibly overlap. return false; } } // There was no dimension along which there is no intersection. // Therefore the boxes overlap. return true; } //Updates the axes after the corners move. Assumes the //corners actually form a rectangle. private void computeAxes() { axis[0] = corner[1].subtract(corner[0]); axis[1] = corner[3].subtract(corner[0]); // Make the length of each axis 1/edge length so we know any // dot product must be less than 1 to fall within the edge. for (int a = 0; a < axis.length; ++a) { axis[a] = axis[a].divide((axis[a].length() * axis[a].length())); origin[a] = corner[0].dot(axis[a]); } } public void moveTo(Vector2D center) { Vector2D centroid = (corner[0].add(corner[1]).add(corner[2]).add(corner[3])).divide(4.0f); Vector2D translation = center.subtract(centroid); for (int c = 0; c < 4; ++c) { corner[c] = corner[c].add(translation); } computeAxes(); computeDimensions(center,angle); } // Returns true if the intersection of the boxes is non-empty. public boolean overlaps(OBB2D other) { if(right() < other.left()) { return false; } if(bottom() < other.top()) { return false; } if(left() > other.right()) { return false; } if(top() > other.bottom()) { return false; } if(other.getAngle() == 0.0f && getAngle() == 0.0f) { return true; } return overlaps1Way(other) && other.overlaps1Way(this); } public Vector2D getCenter() { return center; } public float getWidth() { return extents.x * 2; } public float getHeight() { return extents.y * 2; } public void setAngle(float angle) { set(center,getWidth(),getHeight(),angle); } public float getAngle() { return angle; } public void setSize(float w,float h) { set(center,w,h,angle); } public float left() { return boundingRect.left; } public float right() { return boundingRect.right; } public float bottom() { return boundingRect.bottom; } public float top() { return boundingRect.top; } public RectF getBoundingRect() { return boundingRect; } public boolean overlaps(float left, float top, float right, float bottom) { if(right() < left) { return false; } if(bottom() < top) { return false; } if(left() > right) { return false; } if(top() > bottom) { return false; } return true; } };

    Read the article

  • My screen flickers at 1280 x 1024

    - by abcdefghijklmnopqrstuvwxyz
    My screen flickers at 1280 x 1024, 75 hertz, 32 bit color, Dell Monitor e190s 19 inch square monitor. This problem only at the above mentioned resolution , it works fine with other resolutions. I just bought this Monitor 2 days back, do you think the Monitor is defective ? Why is this problem occurring , the system says this is the recommended resolution. Can it be due to my graphic Card ATI xpress 200, 256 MB (in built). Pentium 4 Windows 7 32 bit OS

    Read the article

  • 1680x1050 via VGA won't work correctly in Windows 7 32bit

    - by Boldor
    I am trying to connect a Samsung 22" SyncMaster with my laptop running Windows 7 32-bit, an AMD HD 6500 Mobility. Though Catalyst Control Centre as well as Windows identify the correct resolution of 1650x1080, and it is selected, it isn't displayed. Looks more like a lower resolution that's getting stretched over the monitor. The weird part: The monitor worked for years without problems, one day it decided not to work properly anymore. Maybe some update issue, I have no idea.

    Read the article

  • How do I get windows 7 to go full screen in boot camp?

    - by Ryan Michela
    I'm running Windows 7 on an iMac using Bootcamp. At the native resolution of 1290x1200, the desktop fills the entire screen, but when I run games at a lower resolution or reduce the suze of the desktop the visible area is reduced and a large black border surrounds the display. I want to run 1024x768 full screen, not letterboxed. Is there a way to do this? I suspect a problem with the drivers.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >