Search Results

Search found 1576 results on 64 pages for 'separating axis theorem'.

Page 17/64 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Screen space to world space

    - by user13414
    I am writing a 2D game where my game world has x axis running left to right, y axis running top to bottom, and z axis out of the screen: Whilst my game world is top-down, the game is rendered on a slight tilt: I'm working on projecting from world space to screen space, and vice-versa. I have the former working as follows: var viewport = new Viewport(0, 0, this.ScreenWidth, this.ScreenHeight); var screenPoint = viewport.Project(worldPoint.NegateY(), this.ProjectionMatrix, this.ViewMatrix, this.WorldMatrix); The NegateY() extension method does exactly what it sounds like, since XNA's y axis runs bottom to top instead of top to bottom. The screenshot above shows this all working. Basically, I have a bunch of points in 3D space that I then render in screen space. I can modify camera properties in real time and see it animate to the new position. Obviously my actual game will use sprites rather than points and the camera position will be fixed, but I'm just trying to get all the math in place before getting to that. Now, I am trying to convert back the other way. That is, given an x and y point in screen space above, determine the corresponding point in world space. So if I point the cursor at, say, the bottom-left of the green trapezoid, I want to get a world space reading of (0, 480). The z coordinate is irrelevant. Or, rather, the z coordinate will always be zero when mapping back to world space. Essentially, I want to implement this method signature: public Vector2 ScreenPointToWorld(Vector2 point) I've tried several things to get this working but am just having no luck. My latest thinking is that I need to call Viewport.Unproject twice with differing near/far z values, calculate the resultant Ray, normalize it, then calculate the intersection of the Ray with a Plane that basically represents ground-level of my world. However, I got stuck on the last step and wasn't sure whether I was over-complicating things. Can anyone point me in the right direction on how to achieve this?

    Read the article

  • How to setup HDMI output on m11x with Nvidia GeForce GT 540M? (Bumblebee) Help?

    - by Alexander Tritan
    I have an Alienware m11x with Optimus Technology. I setup (Fresh Install) Ubuntu 12.04 with bumblebee as below. Please help me set up the HDMI output so that I can connect it to my monitor. $ uname -a Linux ubuntu 3.2.0-24-generic-pae #39-Ubuntu SMP Mon May 21 18:54:21 UTC 2012 i686 i686 i386 GNU/Linux $ lspci | grep -i vga 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev a1) $ dpkg --get-selections bumblebee install bumblebee-nvidia install $ bumblebeed -version bumblebeed --version bumblebeed (Bumblebee) 3.0 Copyright (C) 2011 The Bumblebee Project Should xrandr normally show HDMI? $ xrandr -q Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192 LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 256mm x 144mm 1366x768 60.0*+ 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) $ cat /etc/X11/xorg.conf Section "ServerLayout" Identifier "Layout0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" Option "NoLogo" "true" Option "ConnectedMonitor" "DFP" EndSection $ cat /etc/bumblebee/xorg.conf.nvidia Section "ServerLayout" Identifier "Layout0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" Option "NoLogo" "true" Option "ConnectedMonitor" "DFP" EndSection $ cat /etc/bumblebee/xorg.conf.nouveau Section "ServerLayout" Identifier "Layout0" Screen "Screen0" Option "AutoAddDevices" "true" EndSection Section "Device" Identifier "Device0" Driver "nouveau" EndSection Section "Screen" Identifier "Screen0" Device "Device0" EndSection and finally the biggest config file below: $cat /etc/bumblebee/bumblebee.conf [bumblebeed] VirtualDisplay=:8 KeepUnusedXServer=true ServerGroup=bumblebee TurnCardOffAtExit=false NoEcoModeOverride=false Driver= [optirun] VGLTransport=proxy AllowFallbackToIGC=false PMMethod=none [driver-nvidia] KernelDriver=nvidia-current Module=nvidia PMMethod=none LibraryPath=/usr/lib/nvidia-current:/usr/lib32/nvidia-current XorgModulePath=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules XorgConfFile=/etc/bumblebee/xorg.conf.nvidia [driver-nouveau] KernelDriver=nouveau PMMethod=none XorgConfFile=/etc/bumblebee/xorg.conf.nouveau Any ideas on setting up the Optimus to output to the HDMI T.V.? I want to enable my HDMI with my GeForce GT 540M.

    Read the article

  • How can I move along an angled collision at a constant speed?

    - by Raven Dreamer
    I have, for all intents and purposes, a Triangle class that objects in my scene can collide with (In actuality, the right side of a parallelogram). My collision detection and resolution code works fine for the purposes of preventing a gameobject from entering into the space of the Triangle, instead directing the movement along the edge. The trouble is, the maximum speed along the x and y axis is not equivalent in my game, and moving along the Y axis (up or down) should take twice as long as an equivalent distance along the X axis (left or right). Unfortunately, these speeds apply to the collision resolution too, and movement along the blue path above progresses twice as fast. What can I do in my collision resolution to make sure that the speedlimit for Y axis movement is obeyed in the latter case? Collision Resolution for this case below (vecInput and velocity are the position and velocity vectors of the game object): // y = mx+c lowY = 2*vecInput.x + parag.rightYIntercept ; ... else { // y = mx+c // vecInput.y = 2(x) + RightYIntercept // (vecInput.y - RightYIntercept) / 2 = x; //if velocity.Y (positive) greater than velocity.X (negative) //pushing from bottom, so push right. if(velocity.y > -1*velocity.x) { vecInput = new Vector2((vecInput.y - parag.rightYIntercept)/2, vecInput.y); Debug.Log("adjusted rightwards"); } else { vecInput = new Vector2( vecInput.x, lowY); Debug.Log("adjusted downwards"); } }

    Read the article

  • Move model forward base on model orientation

    - by ChocoMan
    My model rotates on it's own Y-axis regardless of where it is in the world. Here are the controls for the left ThumbStick: UP (move model forward on Z-Axis) DOWN (move model backward on Z-Axis) LEFT & RIGHT (strafe to either side) The problem is adjusting the direction the model's orientation UP and DOWN if the player should also rotate the player while moving forward or backwards. An example what Im trying to achieve would be a car doing donuts. The car is always facing the current direction that it interprets as forward (or rear as backwards) in relation to it's local rotation. Here is how Im calling the movement: // Rotate model with Right Thumbstick along X-Axis modelRotation -= pController.ThumbSticks.Right.X * mRotSpeed; // Move Forward if (pController.IsButtonDown(Buttons.LeftThumbstickUp)) { modelPosition.Z -= -pController.ThumbSticks.Left.Y * speed; } // Move Backward if (pController.IsButtonDown(Buttons.LeftThumbstickDown)) { modelPosition.Z += pController.ThumbSticks.Left.Y * speed; } // Strafe Left if (pController.IsButtonDown(Buttons.LeftThumbstickLeft)) { modelPosition.X += -pController.ThumbSticks.Left.X * speed; } // Strafe Right if (pController.IsButtonDown(Buttons.LeftThumbstickRight)) { modelPosition.X -= pController.ThumbSticks.Left.X * speed; } // DeadZone if (!pController.IsButtonDown(Buttons.LeftThumbstickUp) && !pController.IsButtonDown(Buttons.LeftThumbstickDown) && !pController.IsButtonDown(Buttons.LeftThumbstickLeft) && !pController.IsButtonDown(Buttons.LeftThumbstickRight)) { }

    Read the article

  • How can I resolve collisions at different speeds, depending on the direction?

    - by Raven Dreamer
    I have, for all intents and purposes, a Triangle class that objects in my scene can collide with (In actuality, the right side of a parallelogram). My collision detection and resolution code works fine for the purposes of preventing a gameobject from entering into the space of the Triangle, instead directing the movement along the edge. The trouble is, the maximum speed along the x and y axis is not equivalent in my game, and moving along the Y axis (up or down) should take twice as long as an equivalent distance along the X axis (left or right). Unfortunately, these speeds apply to the collision resolution too, and movement along the blue path above progresses twice as fast. What can I do in my collision resolution to make sure that the speedlimit for Y axis movement is obeyed in the latter case? Collision Resolution for this case below (vecInput and velocity are the position and velocity vectors of the game object): // y = mx+c // solve for y. M = 2, x = input's x coord, c = rightYIntercept lowY = 2*vecInput.x + parag.rightYIntercept ; ... else { // y = mx+c // vecInput.y = 2(x) + RightYIntercept // (vecInput.y - RightYIntercept) / 2 = x; //if velocity.Y (positive) greater than velocity.X (negative) //pushing from bottom, so push right. if(velocity.y > -1*velocity.x) { //change the input vector's x position to match the //y position on the shape's edge. Formula for line: Y = MX+C // M is 2, C is rightYIntercept, y is the input y, solve for X. vecInput = new Vector2((vecInput.y - parag.rightYIntercept)/2, vecInput.y); Debug.Log("adjusted rightwards"); } else { vecInput = new Vector2( vecInput.x, lowY); Debug.Log("adjusted downwards"); } }

    Read the article

  • Screen resolution stuck at 1024x768

    - by Dananjaya
    I just updated from Ubuntu 10.10 to 11.04 and have an issue regarding the screen resolution. I have Intel integrated gfx chip and my monitor supports resolutions larger than 1024x768. (in 10.10 I've been using 1280x1024) But as soon as I upgraded, I'm stuck with 1024x768 resolution and seems I can't change it. running xrandr In terminal yields the following results, Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096 LVDS1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1280x800 58.1 + 1024x768 60.0* 800x600 60.3 56.2 640x480 59.9 VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm 1366x768 59.9 + 1360x768 60.0 1024x768 75.1 72.0 70.1 60.0* 832x624 74.6 800x600 72.2 75.0 60.3 56.2 640x480 72.8 75.0 66.7 60.0 720x400 70.1 1280x1024_60.00 (0xce) 109.0MHz h: width 1280 start 1368 end 1496 total 1712 skew 0 clock 63.7KHz v: height 1024 start 1027 end 1034 total 1063 clock 59.9Hz What maybe the problem? Is it a bug? What kind of steps I should take in order to get a higher resolution? (changing xorg.conf maybe?) Any insight is highly appreciated. Thanks in advance. UPDATE Screenshot after running xrandr --addmode VGA1 1360x768 As you can see, side bar is not completely visible and Ubuntu logo at the task bar is missing. Also when you open an application, the Task bar of the application (where it should go to the top panel) is missing as well..

    Read the article

  • What do ptLineDist and relativeCCW do?

    - by Fasih Khatib
    I saw these methods in the Line2D Java Docs but did not understand what they do? Javadoc for ptLineDist says: Returns the distance from a point to this line. The distance measured is the distance between the specified point and the closest point on the infinitely-extended line defined by this Line2D. If the specified point intersects the line, this method returns 0.0 Doc for relativeCCW says: Returns an indicator of where the specified point (PX, PY) lies with respect to the line segment from (X1, Y1) to (X2, Y2). The return value can be either 1, -1, or 0 and indicates in which direction the specified line must pivot around its first endpoint, (X1, Y1), in order to point at the specified point (PX, PY). A return value of 1 indicates that the line segment must turn in the direction that takes the positive X axis towards the negative Y axis. In the default coordinate system used by Java 2D, this direction is counterclockwise. A return value of -1 indicates that the line segment must turn in the direction that takes the positive X axis towards the positive Y axis. In the default coordinate system, this direction is clockwise. A return value of 0 indicates that the point lies exactly on the line segment. Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues. If the point is colinear with the line segment, but not between the endpoints, then the value will be -1 if the point lies "beyond (X1, Y1)" or 1 if the point lies "beyond (X2, Y2)".

    Read the article

  • Rubik's cube array rotation

    - by Ace
    I'm about to make a 3D Rubik's cube based game in Flash AS3 and Away3d. I don't really know how to manage the 2D arrays of the Rubik's cube. For example, how do I rotate the corresponding arrays if I rotate a side, or just rotate a middle part? In this stage I also don't know how to rotate those smaller cube parts all together if a side is rotating. First I was thinking of "groups" ( like in sketchup or 3ds max, blender), but that would be tricky, because the group components would change every time. So I was thinking of just rotating each individual piece along a global axis. However, I just know the Away3d functions to rotate the cube of his local X , Y or Z axis, but how to rotate in global axis? Does anyone know of a algorithm for doing these types of rotations?

    Read the article

  • Calculate vector direction

    - by Starkers
    Is the direction angle always measured from the plus x axis? Does a vector in the +,+ quadrant always have a direction between 0 and 90, and in -,+ between 90 and 180 and in -,- between 180 and 270 and in -,+ between 270 and 360 ? Also, how should we calculate the direction using tan? Would that mean nested if statements to find out what quadrant we're in, and then applying the appropriate "work arounds"? E.g. If we were in the -,+ (like in the diagram) would we find the angle from the + axis would be 90 + tan^-1(y/x), the 90 + only used because we're in the -,+ quadrant. Also, that's just a quick solution, may be off, I just want to know if we use nested if statements to get the angle from the + x axis. Finally, should we find the distance in degrees or radians?

    Read the article

  • 2D Tile Based Collision Detection

    - by MrPlosion1243
    There are a lot of topics about this and it seems each one addresses a different problem, this topic does the same. I was looking into tile collision detection and found this where David Gouveia explains a great way to get around the person's problem by separating the two axis. So I implemented the solution and it all worked perfectly from all the testes I through at it. Then I implemented more advanced platforming physics and the collision detection broke down. Unfortunately I have not been able to get it to work again which is where you guys come in :)! I will present the code first: public void Update(GameTime gameTime) { if(Input.GetKeyDown(Keys.A)) { velocity.X -= moveAcceleration; } else if(Input.GetKeyDown(Keys.D)) { velocity.X += moveAcceleration; } if(Input.GetKeyDown(Keys.Space)) { if((onGround && isPressable) || (!onGround && airTime <= maxAirTime && isPressable)) { onGround = false; airTime += (float)gameTime.ElapsedGameTime.TotalSeconds; velocity.Y = initialJumpVelocity * (1.0f - (float)Math.Pow(airTime / maxAirTime, Math.PI)); } } else if(Input.GetKeyReleased(Keys.Space)) { isPressable = false; } if(onGround) { velocity.X *= groundDrag; velocity.Y = 0.0f; } else { velocity.X *= airDrag; velocity.Y += gravityAcceleration; } velocity.Y = MathHelper.Clamp(velocity.Y, -maxFallSpeed, maxFallSpeed); velocity.X = MathHelper.Clamp(velocity.X, -maxMoveSpeed, maxMoveSpeed); position += velocity * (float)gameTime.ElapsedGameTime.TotalSeconds; position = new Vector2((float)Math.Round(position.X), (float)Math.Round(position.Y)); if(Math.Round(velocity.X) != 0.0f) { HandleCollisions2(Direction.Horizontal); } if(Math.Round(velocity.Y) != 0.0f) { HandleCollisions2(Direction.Vertical); } } private void HandleCollisions2(Direction direction) { int topTile = (int)Math.Floor((float)Bounds.Top / Tile.PixelTileSize); int bottomTile = (int)Math.Ceiling((float)Bounds.Bottom / Tile.PixelTileSize) - 1; int leftTile = (int)Math.Floor((float)Bounds.Left / Tile.PixelTileSize); int rightTile = (int)Math.Ceiling((float)Bounds.Right / Tile.PixelTileSize) - 1; for(int x = leftTile; x <= rightTile; x++) { for(int y = topTile; y <= bottomTile; y++) { Rectangle tileBounds = new Rectangle(x * Tile.PixelTileSize, y * Tile.PixelTileSize, Tile.PixelTileSize, Tile.PixelTileSize); Vector2 depth; if(Tile.IsSolid(x, y) && Intersects(tileBounds, direction, out depth)) { if(direction == Direction.Horizontal) { position.X += depth.X; } else { onGround = true; isPressable = true; airTime = 0.0f; position.Y += depth.Y; } } } } } From the code you can see when velocity.X is not equal to zero the HandleCollisions() Method is called along the horizontal axis and likewise for the vertical axis. When velocity.X is not equal to zero and velocity.Y is equal to zero it works fine. When velocity.Y is not equal to zero and velocity.X is equal to zero everything also works fine. However when both axis are not equal to zero that's when it doesn't work and I don't know why. I basically teleport to the left side of a tile when both axis are not equal to zero and there is a air block next to me. Hopefully someone can see the problem with this because I sure don't as far as I'm aware nothing has even changed from what I'm doing to what the linked post's solution is doing. Thanks.

    Read the article

  • which web services stacks are supported on JBoss AS 5?

    - by Marina
    Hi, I've been trying to find this info in JBoss docs/forums/WIKIs - but could not get a concise answer to this question: Which web services stacks are supported (or you can make work on) in JBoss 5? I have a huge legacy app using Axis 1 web services which is running fine on WLS9.2. Now I have to migrate it to JBoss 5 and I have to decide whether I can leave Axis1 web services as is (at least for the time being, to get the app working on JBoss at all), or if I have to upgrade web services to Axis 2 or CXF. So, given the three options, Axis 1, Axis 2 and CXF - what does support for them look like on JBoss 5? Any gotchas, pain points, words of wisdom from experience? :)

    Read the article

  • R: ggplot2, how to add a number of layers to a plot at once to reduce code

    - by John
    library(ggplot2) This code produces a nice looking plot: qplot(cty, hwy, data = mpg, colour = displ) + scale_y_log2() + labs(x="x axis") + labs(y="y axis") + opts(title = "my title") But I want to setup variables to try and to reduce code repetition: log_scale <- scale_y_log2() xscale <- labs(x="x axis") yscale <- labs(y="y axis") title <- opts(title = "my title") my_scales <- c(log_scale, xscale, yscale, title) # make a variable to hold the scale info changes above So that I can do this and add a bunch of things at the same time: qplot(cty, hwy, data = mpg, colour = displ) + my_scales # add these to your plot. but I get this error: Error in object$class : $ operator is invalid for atomic vectors I realize that the things going into my_scales need to be layers / different types of objects, but I don't see what they should be.

    Read the article

  • Display continuous dates in Pivot Chart

    - by Douglas
    I have a set of data in a pivot table with date times and events. I've made a pivot chart with this data, and grouped the data by day and year, then display a count of events for each day. So, my horizontal axis goes from 19 March 2007 to 11 May 2010, and my vertical axis is numeric, going from zero to 140. For some days, I have zero events. These days don't seem to be shown on the horizontal axis, so 2008 is narrower than 2009. How do I display a count of zero for days with no events? I'd like my horizontal axis to be continuous, so that it does not miss any days, and every month ends up taking up the same amount of horizontal space. (This question is similar to the unanswered question here, but I'd rather not generate a table of all the days in the last x number of years just to get a smooth plot!)

    Read the article

  • Adding a decal using multitexturing on an iPhone

    - by Axis
    I'm trying to overlay one image on top of another onto a simple quad. I set my bottom image as texture unit 0, and then my top image (which has a variable alpha) as texture unit 1. Unit 2 has mode GL_DECAL, which means the bottom texture should show up when the alpha is 0, and the top texture should show when the alpha is 1. But, only the top texture shows up and the bottom one doesn't appear at all. It's just white where the bottom texture should show through. glGetError() doesn't report any problems. Any help is appreciated. Thanks! glVertexPointer(3, GL_FLOAT, 0, boxVertices); glEnableClientState(GL_VERTEX_ARRAY); glClientActiveTexture(GL_TEXTURE0); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 0, boxTextureCoords); glClientActiveTexture(GL_TEXTURE1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 0, boxTextureCoords); glClientActiveTexture(GL_TEXTURE0); glEnable(GL_TEXTURE_2D); glClientActiveTexture(GL_TEXTURE1); glEnable(GL_TEXTURE_2D); glClientActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, one.texture); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glClientActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, two.texture); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glDrawArrays(GL_TRIANGLE_FAN, 0, 4);

    Read the article

  • Microsoft Chart Control labels

    - by Serge
    Hello, I've been searching for a while and browsing through the samples but could not find a solution to my problem. In Microsoft Chart Control I have created a line series that plots real-time data. As new data points are added, the chart margins will sometimes jump on the form. I have tried disabling the grid lines and have determined that the margins change when the x-axis label overlaps with the y-axis label. I have tried auto-fitting the labels but that does not seem to work probably because it treat x-axis and y-axis separately. Is there any way to prevent the overlap, or keep the labels and corresponding grid lines stationery and just change their value when the data scrolls? Thank you for your help.

    Read the article

  • TypeError when using v 0.8.1 of FLOT library, but no error with v. 0.7

    - by DanielAttard
    I need some help to figure out why I am getting an error when trying to create a simple graph using the jQuery FLOT library. When I reference version 0.7 of the FLOT library, the page renders correctly: http://attardpropertytax.ca/flot07.html But when I switch to version 0.8.1 of the FLOT library, the page returns an error saying: Uncaught TypeError: Cannot read property 'left' of null http://attardpropertytax.ca/flot81.html The HTML is the same for both pages, so I cannot figure out why the new version 0.8.1 of FLOT returns an error, but the old version 0.7 does not. Any ideas? I somehow stumbled across a work-around that managed to fix my problem. I'm nut sure why, but I had to comment-out the following two sections of code from the v. 0.8.1 FLOT library: This was the first spot: // If the grid is visible, add its border width to the offset for (var a in plotOffset) { if(typeof(options.grid.borderWidth) == "object") { plotOffset[a] += showGrid ? options.grid.borderWidth[a] : 0; } else { plotOffset[a] += showGrid ? options.grid.borderWidth : 0; } } And this was the second spot: if (isNaN(v) || v < axis.min || v > axis.max // skip those lying on the axes if we got a border || (t == "full" && ((typeof bw == "object" && bw[axis.position] > 0) || bw > 0) && (v == axis.min || v == axis.max))) continue; I'm sure eventually @DNS will be taking a look at this question and maybe he will be able to help me understand what is going wrong with my code. Thanks.

    Read the article

  • Mysterious Flickering Visual Artifact

    - by Axis
    A flashing bar of red appears at the top of the EAGLView that I have added as a subview in my iPhone app. It flickers on and off (i.e., one frame it's there, the next frame it's not, the next frame it's there again). I have removed a lot of code from my app until I'm essentially left with the stock OpenGL-ES project and a few changes: The glview is not fullscreen; it's a subview. I enabled the depth buffer. I'm not even trying to draw anything. If the glview is fullscreen, or if I disable the depth buffer, then there is no flicker and it works fine. But needless to say, this is a 3D view and I'd like to be able to display it within a larger UIKit view. I'm not sure what code would be useful to post, but here's how I add the glview to my main view: appDelegate.glView.frame = CGRectMake(245, 65, 215, 215); [self.view addSubview:appDelegate.glView]; [appDelegate.glView startAnimation]; Here's my render function: - (void) render { [EAGLContext setCurrentContext:context]; glBindFramebufferOES(GL_FRAMEBUFFER_OES, defaultFramebuffer); glViewport(0, 0, backingWidth, backingHeight); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer); [context presentRenderbuffer:GL_RENDERBUFFER_OES]; } It seems pretty obvious to me that the problem lies with the depth buffer somehow, but I'm not sure why. Also, it works fine in the simulator, but not on my iphone. I'm using iPhone OS 3.1. Any ideas on where to look for a problem?

    Read the article

  • Display continious dates in Pivot Chart

    - by Douglas
    I have a set of data in a pivot table with date times and events. I've made a pivot chart with this data, and grouped the data by day and year, then display a count of events for each day. So, my horizontal axis goes from 19 March 2007 to 11 May 2010, and my vertical axis is numeric, going from zero to 140. For some days, I have zero events. These days don't seem to be shown on the horizontal axis, so 2008 is narrower than 2009. How do I display a count of zero for days with no events? I'd like my horizontal axis to be continuous, so that it does not miss any days, and every month ends up taking up the same amount of horizontal space. (This question is similar to the unanswered question here, but I'd rather not generate a table of all the days in the last x number of years just to get a smooth plot!)

    Read the article

  • undo or reverse argsort(), python

    - by Vincent
    Given an array 'a' I would like to sort the array by columns "a.sort(axis=0)" do some stuff to the array and then undo the sort. By that I don't mean re sort but basically reversing how each element was moved. I assume argsort() is what I need but it is not clear to me how to sort an array with the results of argsort() or more importantly apply the reverse/inverse of argsort() Here is a little more detail I have an array a, shape(a) = rXc I need to sort each column aargsort = a.argsort(axis=0) # May use this later aSort = a.sort(axis=0) now average each row aSortRM = asort.mean(axis=1) now replace each col in a row with the row mean. is there a better way than this aWithMeans = ones_like(a) for ind in range(r) # r = number of rows aWithMeans[ind]* aSortRM[ind] Now I need to undo the sort I did in the first step. ????

    Read the article

  • Looking for a chart of Wpf Bindings

    - by BSalita
    I'm probably typical in being bewildered by the many syntaxes of Wpf binding. Does anyone know of a chart that lays out all the possibilities. Across one axis is all the variations of binding syntaxes (Static, Dynamic, Self, ...), the other axis are all the variations of scoping and type. The intersection of the axis show an example. Surely someone, some author has done this, eh?

    Read the article

  • Can NP-Intermediate exist if P = NP?

    - by Jason Baker
    My understanding is that Ladner's theorem is basically this: P != NP implies that there exists a set NPI where NPI is not in P and NPI is not NP-complete What happens to this theorem if we assume that P = NP rather than P != NP? We know that if NP Intermediate doesn't exist, then P = NP. But can NP Intermediate exist if P = NP?

    Read the article

  • Creating a top-down spaceship

    - by Ali
    I'm creating a top-down 2D space game in LIBGDX for android. When spaceship is going forward it will look like this: when it goes upward I want to change it's direction with a nice animation so it seems like a real spaceship. A between frame would be like this: I have rendered the spaceship in different Z axis degrees from ship0 to ship90. Calculating rotation on XY plane wouldn't be so hard, but I don't know how to calculate the rotation on Z axis so I can choose the right sprite to use.

    Read the article

  • Matrix rotation wrong orientation LibGDX

    - by glz
    I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in the world orientation. For example: on create() method: matrix.rotate(new Vector3(0,0,1), 45); That is ok, but after: on render() method: matrix.rotate(new Vector3(0,1,0), 1); I need it rotate in world axis.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >