Daily Archives

Articles indexed Monday October 28 2013

Page 16/17 | < Previous Page | 12 13 14 15 16 17  | Next Page >

  • Diskless Workstations

    - by guettli
    I want to run diskless booting with PXE. The gotchas at the end of the Diskless-Howto[1] is quite long. I am unsure how to get this done. Here are my current possible solutions: use debian live and not ubuntu use aufs [2] The How-To states "confirmed to work with Ubuntu 12.04.". But maybe I am doing something wrong, I don't think it works this way for several diskless clients sharing one nfsroot. What is the most painless way to get diskless workstations? PS: I can't create the new tag "diskless". Please create and add it. Thank you. 1: https://help.ubuntu.com/community/DisklessUbuntuHowto 2: https://help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash

    Read the article

  • 1080p on TV not working

    - by and471
    I am trying to connect my laptop (Samsung Series 5 Ultrabook) to my TV (Toshiba WLT66/67 Series) and get it to output to the TV at 1080i (so basically 1920x1080) through HDMI The issue I have is that in 'Displays' the highest resolution that it gives the monitor is 1280x768, however I know that the TV can output at 1920x1080 at 30Hz as when I use Windows 7 it allows me to do this. I looked around and found that I could use xrandr to try and get his resolution, however when I do: cvt 1920 1080 30 # 1920x1080 29.95 Hz (CVT) hsync: 33.01 kHz; pclk: 79.75 MHz Modeline "1920x1080_30.00" 79.75 1920 1976 2168 2416 1080 1083 1088 1102 -hsync +vsync xrandr --newmode "1920x1080_30.00" 79.75 1920 1976 2168 2416 1080 1083 1088 1102 -hsync +vsync xrandr --addmode HDMI1 1920x1080_30.00 xrandr --output HDMI1 --mode 1920x1080_30.00 My TV screen just remains blank :( Any help? (if you need any more information please ask)

    Read the article

  • How to make browser offer "remember password"

    - by Alois Mahdal
    What properties login form needs to have to trigger "remember password" for all (or most) browsers? Background: For years I have been using Opera, and the rule has been that almost anything that looks like login form triggers this feature. Now I'm exploring other browsers, and surprisingly find that one of login forms I visit most often, Roundcube login page, does not trigger this feature neither in Chromium nor Firefox (tried various versions and page setups of RC). Since it's on my VPS, I could patch it up and eventually even send that to RC development team, but I have the unnerving feeling that this must have been solved over and over, and it's just me being blind or something. So again: is there any consensus between browser developer as to when this featue should be triggered? Is there a best practice for webmasters to tell the browser "this is the login page"? Or are all browsers doing their own heuristics?

    Read the article

  • Problem in domain name of site in google search [on hold]

    - by Jayadratha Mondal
    My domain provider dont supports advanced DNS at this moment. So I have used iframe to forward to my webserver. Suppose my domain abc.com have a simple html which is opening xyz.com via Iframe. Google was showing abc.com on the search. But from last two days it is showing xyz.com, other things like description, name of the site are ok only the domain changed to xyz.com, but I want to show abc.com. When I'm typing the full domain then google showing the domain as I want. But If I type a part or any keyword then it showing that xyz.com. Anyone have any idea how to show abc.com again? EDIT: I dont know the domain name provider because its not mine. When I'm trying to set new A record its showing that "you need advanced dns to do this currently you are using simple DNS". I'm doing this from cpanel. Normally as per I know there are 3 sections. 1 domain name 2 A record 3Cname. But I dont have any domain name section.

    Read the article

  • Which token from a long User-Agent should I use in robots.txt?

    - by Gaia
    The definition of User-Agent states that several tokens can be included, as deemed necessary by the client. I want to block certain bots via robots.txt and I am confused as to which part of the User-Agent string to use, especially for more obscure bots. For example: Mozilla/5.0 (compatible; uMBot-LN/1.0; mailto: [email protected])" JS-Kit URL Resolver, http://js-kit.com/ Mozilla/5.0 (compatible; SEOkicks-Robot +http://www.seokicks.de/robot.html Do I use the second token? Can tokens contain spaces, or did the SEOkicks folks forget a semicolon after SEOkicks-Robot? I don't actually intend on making my question specific to a couple bots - I want to know the guideline: which part of UA do I place in robots.txt for these exotic bots with UA as long as a haiku? User-agent: uMBot-LN/1.0 Disallow: / PS: Thank you but I do not need to hear that undesirable bots are better blocked with mod_security. I already have commercial mod_sec rules in place.

    Read the article

  • Using rel=next and rel=prev with multiple sets of paginated content on the same page

    - by jakejgordon
    We are running into issues with trying to figure out how to implement rel="next" and rel="prev" -- coupled with rel="canonical" -- with multiple sets of paginated content on the same page, with pages in multiple cultures. In other words, how do we implement these when we have a pager for both Product Reviews and Questions and Answers (aka "Q&A") on the same page, with duplicate content across culture-specific URLs (e.g. /us/en/my-product vs. /ca/en/my-product)? Our current implementation will actually do a full postback when you click Page 2, and will add something to the query string (e.g. website.com/ca/en/my-product?previewpage=2 or website.com/ca/en/my-product?questionpage=2). If we only had one set of paginated content then the implementation would certainly be more straightforward. Adding a second set of paginated content (i.e. Q&A) complicates things. Let's assume that we want the United States English page to be the canonical target (i.e. /us/en/my-product) based on culture. If you go to the /ca/en/my-product page you'll have a rel="canonical" href="/us/en/my-product". So far so good. Let's also assume that we are not implementing a page that lists ALL Product Reviews and Q&A. This would likely solve a number of our problems by using rel="canonical" to this page, but is not an option for reasons that are out of scope for this discussion. Now if you click on page 2 of Product Reviews, it will reload the page with /ca/en/my-product?reviewpage=2 as the URL. Given this scenario, here are my questions: On page 2 of the my-product page on the Canadian site, should there be a rel="canonical" to /us/en/my-product?reviewpage=2 (assuming the content is identical in the United States and Canada)? Should the rel="prev" go to /ca/en/my-product?reviewpage=1 or should it go to /ca/en/my-product ? The query-string version would really only be accessible if using the pager and shows the exact same content as the base page. The following two questions are closely related to this one. Should the /ca/en/my-product?reviewpage=1 have a rel canonical directly to /us/en/my-product (United States page with nothing in query string) since the content is identical)? Given that Q&A content is also paginated, should there be a rel="next" on the base page without query string? In other words, should the /ca/en/my-product page have a rel="next" to /ca/en/my-product?reviewpage=2 AND rel="next" to /ca/en/my-product?questionpage=2 . So far as I can tell it doesn't make sense to have multiple rel="next" implementations on the same page. I suspect that the pages with query string values should have rel="next" and rel="prev" that only point to other pages with query strings and not to the base page. The ?reviewpage=1 and ?questionpage=1 pages would then just have a rel="canonical" to /us/en/my-product . Thoughts? I know this is a tough one -- that's why I brought it to this community. Thanks so much for your help in advance!

    Read the article

  • Website only displays correctly in IE using compatibility mode?

    - by user21318
    As the resident "IT Whiz" at work (ie: I know how to use a computer) I've been asked to develop a website for our small business. I've altered a wordpress theme for the time being and the company is very happy with the results. The only problem I am having with it at the moment is that for some reason the website does not display correctly and Internet Explorer unless I run it in Compatibility Mode. The main problem that I have is that my menu "slider" (it rotates pictures with links to articles etc) does not display at all, neither does the top menu they are just blink text based links. Even with Compatibility Mode enabled the slider and menus come back but the page is not centered unlike on both Firefox and Chrome. My googling has suggested the most common cause of this is old code but I'm not sure where to be looking. Is it likely in the css file or the actual php? Also any ideas on how to trouble shoot the cause of this? As in is there some dev tools or debugger I can use that would highlight "broken" code for me?

    Read the article

  • Extend depth of .htaccess to all subfolders and their children

    - by JoXll
    I need to be able to use .htaccess in all subfolders for full depth. E.g. I have .htaccess in public_html folder: \public_html\.htaccess How I make it to work for the folder small as well? \public_html\home\images\red\thumbs\small\ It only enforces up to home directory not more. ErrorDocument 403 http://google.com Order Deny,Allow Deny from all Allow from 11.22.33.44 Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    Read the article

  • Sending state diffs (deltas) and unreliable connections

    - by spaceOwl
    We're building a realtime multiplayer game, in which each player is responsible for reporting its state on every iteration of the game loop. The state updates are broadcasted using unreliable UDP. To minimize state data sending, we've come up with a system that will send only deltas (whatever state data that was changed). This method however is flawed, since a lost packet will mean that other players will not receive the delta, making the game behave in an unexpected way. For example: Assume that state is comprised of: { positionX, positionY, health } Frame 1 - positionX changed --> send a packet with positionX only. Frame 2 - health changed // lost ! Frame 3 - positionY changed --> send a packet with positionY only. // Other players don't know about health change. How can one overcome this issue then? sending the entire data is not always feasible.

    Read the article

  • Best way to implement an AI for Dominion? [on hold]

    - by j will
    I'm creating a desktop client and server backend for the game, Dominion, by Donald X. Vaccarino. I've been reading up on AI techniques and algorithms and I just wanted to what is the best way to implement an AI for such a game? Would it better to look at neural networks, genetic algorithms, decision trees, fuzzy logic, or any other methodology? For those who do not know how Dominion works, check out this part of the wikipedia article: http://en.wikipedia.org/wiki/Dominion_(card_game)#Gameplay

    Read the article

  • Artificial Intelligence ... how to make an object roam freely/avoid other objects, and model consciousness? [on hold]

    - by help bonafide pigeons
    Say a simple free roam battle scene in which a player runs around freely and engages in battle with other enemies/objects, as shown below: The dragon/dinosaur (or whatever that thing I drew appears to be) will, by some measure, try and avoid attacks so it is modeled to appear to have a conscious desire to avoid pain. My question is ... since this is very complex, many possible strategies for solving this, algorithms, etc., what is the basic idea behind how this would be accomplished in any sort? Like, we can assume the enemy in the picture is not just going to aimlessly hop around and avoid, but freely be modeled to behave as if it were really exploring/fighting. For the best example I can give, witness the behavior of the enemies in Final Fantasy 12 in this video: http://www.youtube.com/watch?v=mO0TkmhiQ6w How do the pros, or how would anyone attempt solve/implement this? PS: I have tried several times to give an image the "illusion" that is has a conciousness, but aside from emulating a real animal's consciousness in complete, I fall short and get choppy moving images that follow predictable patterns, error-prone movements, and the worst imaginable scenario of a battle engagement.

    Read the article

  • Jumping over non-stationary objects without problems ... 2-D platformer ... how could this be solved? [on hold]

    - by help bonafide pigeons
    You know this problem ... take Super Mario Bros. for example. When Mario/Luigi/etc. comes in proximity with a nearing pipe image an invisible boundary setter must prevent him from continuing forward movement. However, when you jump and move both x and y you are coordinately moving in two dimensions at an exact time. When nearing the pipe in mid-air as you are falling, i.e. implementation of gravity in the computer program "pulling" the image back down, and you do not want them to get "stuck" in both falling and moving. That problem is solved, but how about this one: The player controlling the ball object is attempting to jump and move rightwards over the non-stationary block that moves up and down. How could we measure its top and lower x+y components to determine the safest way for the ball to accurately either fall back down, or catch the ledge, or get pushed down under it, etc.?

    Read the article

  • Android Game Development in Java [on hold]

    - by Nusrat
    I have been searching for some good tutorials/frameworks for developing an Android Game . I want to develop a 3D Car Racing game . I have already looked into http://stackoverflow.com/questions/4227759/android-game-engine-for-2d-and-3d-games. Now , i know that Android Games can be developed using Java/Action Scripts/JS etc . Many of the users are suggesting me to use http://unity3d.com , but i found that it uses JavaScript, C#, Boo . I don't know JS too much , Is it possible to develop a very professional level Game for Android using my Java knowledge ? Any Software like Unity which allow me to code in Java ?

    Read the article

  • Issue with DFS imlemtation in objetive-c

    - by Hemant
    i am trying to to do something like this Below is my code: -(id) init{ if( (self=[super init]) ) { bubbles_Arr = [[NSMutableArray alloc] initWithCapacity: 9]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"1",@"1",@"1",@"1",@"1",nil] atIndex:0]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"3",@"3",@"5",@"5",@"1",nil] atIndex:1]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"5",@"3",@"5",@"3",@"1",nil] atIndex:2]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"5",@"3",@"5",@"3",@"1",nil] atIndex:3]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"1",@"1",@"1",@"1",@"1",nil] atIndex:4]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"5",@"5",@"3",@"5",@"1",nil] atIndex:5]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"5",@"5",@"5",@"5",@"5",nil] atIndex:6]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"5",@"5",@"5",@"5",@"5",nil] atIndex:7]; [bubbles_Arr insertObject:[NSMutableArray arrayWithObjects:@"5",@"5",@"5",@"5",@"5",nil] atIndex:8]; NOCOLOR = @"-1"; R = 9; C = 5; [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(testting) userInfo:Nil repeats:NO]; } return self; } -(void)testting{ // NSLog(@"dataArray---- %@",dataArray.description); int startR = 0; int startC = 0; int color = 1 ;// red // NSString *color = @"5"; //reset visited matrix to false. for(int i = 0; i < R; i++) for(int j = 0; j < C; j++) visited[i][j] = FALSE; //reset count count = 0; [self dfs:startR :startC :color :false]; NSLog(@"count--- %d",count); NSLog(@"test--- %@",bubbles_Arr); } -(void)dfs:(int)ro:(int)co:(int)colori:(BOOL)set{ for(int dr = -1; dr <= 1; dr++) for(int dc = -1; dc <= 1; dc++) if((dr == 0 ^ dc == 0) && [self ok:ro+dr :co+dc]) // 4 neighbors { int nr = ro+dr; int nc = co+dc; NSLog(@"-- %d ---- %d",[[[bubbles_Arr objectAtIndex:nr] objectAtIndex:nc] integerValue],colori); if ((([[[bubbles_Arr objectAtIndex:nr] objectAtIndex:nc] integerValue]==1 || [[[bubbles_Arr objectAtIndex:nr] objectAtIndex:nc] isEqualToString:@"1"]) && !visited[nr][nc])) { visited[nr][nc] = true; count++; [self dfs:nr :nc :colori :set]; if(count>2) { [[bubbles_Arr objectAtIndex:nr] replaceObjectAtIndex:nc withObject:NOCOLOR]; [bubbles[nc+1][nr+1] setTexture:[[CCTextureCache sharedTextureCache] addImage:@"gray_tiger.png"]]; } } } } -(BOOL)ok:(int)r:(int)c{ return r >= 0 && r < R && c >= 0 && c < C; } But it's only working for left to right,not working for right to left. And it is also skipping first object. Thanks in advance.

    Read the article

  • Problems with SAT Collision Detection

    - by DJ AzKai
    I'm doing a project in one of my modules for college in C++ with SFML and I was hoping someone may be able to help me. I'm using a vector of squares and triangles and I am using the SAT collision detection method to see if objects collide and to make the objects respond to the collision appropriately using the MTV(minimum translation vector) Below is my code: //from the main method int main(){ // Create the main window sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML OpenGL"); // Create a clock for measuring time elapsed sf::Clock Clock; srand(time(0)); //prepare OpenGL surface for HSR glClearDepth(1.f); glClearColor(0.3f, 0.3f, 0.3f, 0.f); //background colour glEnable(GL_DEPTH_TEST); glDepthMask(GL_TRUE); //// Setup a perspective projection & Camera position glMatrixMode(GL_PROJECTION); glLoadIdentity(); //set up a 3D Perspective View volume //gluPerspective(90.f, 1.f, 1.f, 300.0f);//fov, aspect, zNear, zFar //set up a orthographic projection same size as window //this mease the vertex coordinates are in pixel space glOrtho(0,800,0,600,0,1); // use pixel coordinates // Finally, display rendered frame on screen vector<BouncingThing*> triangles; for(int i = 0; i < 10; i++) { //instantiate each triangle; triangles.push_back(new BouncingTriangle(Vector2f(rand() % 700, rand() % 500), 3)); } vector<BouncingThing*> boxes; for(int i = 0; i < 10; i++) { //instantiate each box; boxes.push_back(new BouncingBox(Vector2f(rand() % 700, rand() % 500), 4)); } CollisionDetection * b = new CollisionDetection(); // Start game loop while (App.isOpen()) { // Process events sf::Event Event; while (App.pollEvent(Event)) { // Close window : exit if (Event.type == sf::Event::Closed) App.close(); // Escape key : exit if ((Event.type == sf::Event::KeyPressed) && (Event.key.code == sf::Keyboard::Escape)) App.close(); } //Prepare for drawing // Clear color and depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Apply some transformations glMatrixMode(GL_MODELVIEW); glLoadIdentity(); for(int i = 0; i < 10; i++) { triangles[i]->draw(); boxes[i]->draw(); triangles[i]->update(Vector2f(800,600)); boxes[i]->draw(); boxes[i]->update(Vector2f(800,600)); } for(int j = 0; j < 10; j++) { for(int i = 0; i < 10; i++) { triangles[j]->setCollision(b->CheckCollision(*(triangles[j]),*(boxes[i]))); } } for(int j = 0; j < 10; j++) { for(int i = 0; i < 10; i++) { boxes[j]->setCollision(b->CheckCollision(*(boxes[j]),*(triangles[i]))); } } for(int i = 0; i < triangles.size(); i++) { for(int j = i + 1; j < triangles.size(); j ++) { triangles[j]->setCollision(b->CheckCollision(*(triangles[j]),*(triangles[i]))); } } for(int i = 0; i < triangles.size(); i++) { for(int j = i + 1; j < triangles.size(); j ++) { boxes[j]->setCollision(b->CheckCollision(*(boxes[j]),*(boxes[i]))); } } App.display(); } return EXIT_SUCCESS; } (ignore this line) //from the BouncingThing.cpp BouncingThing::BouncingThing(Vector2f position, int noSides) : pos(position), pi(3.14), radius(3.14), nSides(noSides) { collided = false; if(nSides ==3) { Vector2f vert1 = Vector2f(-12.0f,-12.0f); Vector2f vert2 = Vector2f(0.0f, 12.0f); Vector2f vert3 = Vector2f(12.0f,-12.0f); verts.push_back(vert1); verts.push_back(vert2); verts.push_back(vert3); } else if(nSides == 4) { Vector2f vert1 = Vector2f(-12.0f,12.0f); Vector2f vert2 = Vector2f(12.0f, 12.0f); Vector2f vert3 = Vector2f(12.0f,-12.0f); Vector2f vert4 = Vector2f(-12.0f, -12.0f); verts.push_back(vert1); verts.push_back(vert2); verts.push_back(vert3); verts.push_back(vert4); } velocity.x = ((rand() % 5 + 1) / 3) + 1; velocity.y = ((rand() % 5 + 1) / 3 ) +1; } void BouncingThing::update(Vector2f screenSize) { Transform t; t.rotate(0); for(int i=0;i< verts.size(); i++) { verts[i]=t.transformPoint(verts[i]); } if(pos.x >= screenSize.x || pos.x <= 0) { velocity.x *= -1; } if(pos.y >= screenSize.y || pos.y <= 0) { velocity.y *= -1; } if(collided) { //velocity.x *= -1; //velocity.y *= -1; collided = false; } pos += velocity; } void BouncingThing::setCollision(bool x){ collided = x; } void BouncingThing::draw() { glBegin(GL_POLYGON); glColor3f(0,1,0); for(int i = 0; i < verts.size(); i++) { glVertex2f(pos.x + verts[i].x,pos.y + verts[i].y); } glEnd(); } vector<Vector2f> BouncingThing::getNormals() { vector<Vector2f> normalVerts; if(nSides == 3) { Vector2f ab = Vector2f((verts[1].x + pos.x) - (verts[0].x + pos.x), (verts[1].y + pos.y) - (verts[0].y + pos.y)); ab = flip(ab); ab.x *= -1; normalVerts.push_back(ab); Vector2f bc = Vector2f((verts[2].x + pos.x) - (verts[1].x + pos.x), (verts[2].y + pos.y) - (verts[1].y + pos.y)); bc = flip(bc); bc.x *= -1; normalVerts.push_back(bc); Vector2f ac = Vector2f((verts[2].x + pos.x) - (verts[0].x + pos.x), (verts[2].y + pos.y) - (verts[0].y + pos.y)); ac = flip(ac); ac.x *= -1; normalVerts.push_back(ac); return normalVerts; } if(nSides ==4) { Vector2f ab = Vector2f((verts[1].x + pos.x) - (verts[0].x + pos.x), (verts[1].y + pos.y) - (verts[0].y + pos.y)); ab = flip(ab); ab.x *= -1; normalVerts.push_back(ab); Vector2f bc = Vector2f((verts[2].x + pos.x) - (verts[1].x + pos.x), (verts[2].y + pos.y) - (verts[1].y + pos.y)); bc = flip(bc); bc.x *= -1; normalVerts.push_back(bc); return normalVerts; } } Vector2f BouncingThing::flip(Vector2f v){ float vyTemp = v.x; float vxTemp = v.y * -1; return Vector2f(vxTemp, vyTemp); } (Ignore this line) CollisionDetection::CollisionDetection() { } vector<float> CollisionDetection::bubbleSort(vector<float> w) { int temp; bool finished = false; while (!finished) { finished = true; for (int i = 0; i < w.size()-1; i++) { if (w[i] > w[i+1]) { temp = w[i]; w[i] = w[i+1]; w[i+1] = temp; finished=false; } } } return w; } class Vector{ public: //static int dp_count; static float dot(sf::Vector2f a,sf::Vector2f b){ //dp_count++; return a.x*b.x+a.y*b.y; } static float length(sf::Vector2f a){ return sqrt(a.x*a.x+a.y*a.y); } static Vector2f add(Vector2f a, Vector2f b) { return Vector2f(a.x + b.y, a.y + b.y); } static sf::Vector2f getNormal(sf::Vector2f a,sf::Vector2f b){ sf::Vector2f n; n=a-b; n/=Vector::length(n);//normalise float x=n.x; n.x=n.y; n.y=-x; return n; } }; bool CollisionDetection::CheckCollision(BouncingThing & x, BouncingThing & y) { vector<Vector2f> xVerts = x.getVerts(); vector<Vector2f> yVerts = y.getVerts(); vector<Vector2f> xNormals = x.getNormals(); vector<Vector2f> yNormals = y.getNormals(); int size; vector<float> xRange; vector<float> yRange; for(int j = 0; j < xNormals.size(); j++) { Vector p; for(int i = 0; i < xVerts.size(); i++) { xRange.push_back(p.dot(xNormals[j], Vector2f(xVerts[i].x, xVerts[i].x))); } for(int i = 0; i < yVerts.size(); i++) { yRange.push_back(p.dot(xNormals[j], Vector2f(yVerts[i].x , yVerts[i].y))); } yRange = bubbleSort(yRange); xRange = bubbleSort(xRange); if(xRange[xRange.size() - 1] < yRange[0] || yRange[yRange.size() - 1] < xRange[0]) { return false; } float x3 = Min(xRange[0], yRange[0]); float y3 = Max(xRange[xRange.size() - 1], yRange[yRange.size() - 1]); float length = Max(x3, y3) - Min(x3, y3); } for(int j = 0; j < yNormals.size(); j++) { Vector p; for(int i = 0; i < xVerts.size(); i++) { xRange.push_back(p.dot(yNormals[j], xVerts[i])); } for(int i = 0; i < yVerts.size(); i++) { yRange.push_back(p.dot(yNormals[j], yVerts[i])); } yRange = bubbleSort(yRange); xRange = bubbleSort(xRange); if(xRange[xRange.size() - 1] < yRange[0] || yRange[yRange.size() - 1] < xRange[0]) { return false; } } return true; } float CollisionDetection::Min(float min, float max) { if(max < min) { min = max; } else return min; } float CollisionDetection::Max(float min, float max) { if(min > max) { max = min; } else return min; } On the screen the objects will freeze for a small amount of time before moving off again. However the problem is is that when this happens there are no collisions actually happening and I would really love to find out where the flaw is in the code. If you need any more information/code please don't hesitate to ask and I'll reply as soon as possible Regards, AzKai

    Read the article

  • Best practices of texture size

    - by psal
    I wanted to know how should I determine a good texture size ? Currently, I always create UV texture that are 1024x1024px but if I create for example, a big house with a 1024px texture size, it will looks pretty bad. So, should I create different texture size (512, 1024, ...) for different mesh size like this ? : or is it better to always do high-resolution texture and then reduce it in the software (ie : increase the LODBias settings in UDK reduce the size of the texture) ? Thanks for your answer. ps : sorry for my english !

    Read the article

  • Physics Loop in a NodeJS/Socket.IO Environment

    - by Thomas Mosey
    I'm developing a 2D HTML5 Canvas Game, and I am trying to think of the most efficient way to implement a Physics Loop on the server-end of things, running NodeJS and Socket.IO. The only method I've thought of is using setTimeout/Interval, is there any better way? Any examples would be appreciated. EDIT: The Game is a top-down Game, like Zelda and older Pokemon Games. Most of the physics done in the loop will be simple intersects.

    Read the article

  • How do I clip an image in OpenGL ES on Android?

    - by Maxim Shoustin
    My game involves "wiping off" an image by touch: After moving a finger over it, it looks like this: At the moment, I'm implementing it with Canvas, like this: 9Paint pTouch; 9int X = 100; 9int Y = 100; 9Bitmap overlay; 9Canvas c2; 9Rect dest; pTouch = new Paint(Paint.ANTI_ALIAS_FLAG); pTouch.setXfermode(new PorterDuffXfermode(Mode.SRC_OUT)); pTouch.setColor(Color.TRANSPARENT); pTouch.setMaskFilter(new BlurMaskFilter(15, Blur.NORMAL)); overlay = BitmapFactory.decodeResource(getResources(),R.drawable.wraith_spell).copy(Config.ARGB_8888, true); c2 = new Canvas(overlay); dest = new Rect(0, 0, getWidth(), getHeight()); Paint paint = new Paint();9 paint.setFilterBitmap(true); ... @Override protected void onDraw(Canvas canvas) { ... c2.drawCircle(X, Y, 80, pTouch); canvas.drawBitmap(overlay, 0, 0, null); ... } @Override 9public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_MOVE: { X = (int) event.getX(); Y = (int) event.getY();9 invalidate(); c2.drawCircle(X, Y, 80, pTouch);9 break; } } return true; ... What I'm essentially doing is drawing transparency onto the canvas, over the red ball image. Canvas and Bitmap feel old... Surely there is a way to do something similar with OpenGL ES. What is it called? How do I use it? [EDIT] I found that if I draw an image and above new image with alpha 0, it goes to be transparent, maybe that direction? Something like: gl.glColor4f(0.0f, 0.0f, 0.0f, 0.01f);

    Read the article

  • Coordinate and positioning problem on iOS with cocos2d-x

    - by Vexille
    I'm using cocos2d-x alongside with Marmalade and running some tests and tutorials before starting an actual project with them. So far things are working reasonably well on the windows simulator, Android and even on Blackberry's Playbook, but on iOS devices (iPhone and iPad) the positioning seems to be off. To make things clearer, I put together a scene that just draws an image in the middle of the screen. It worked as expected on everything else, but this is the result I got on an iPhone: To get the coordinates for the center of the screen I'm using the VisibleRect class from the TestCpp sample. It just uses sharedOpenGLView to get the visible size and visible origin, and calculate the center from that. CCSprite* test = CCSprite::create("Ball.png", CCRectMake(0, 0, 80, 80) ); test->setPosition( ccp(VisibleRect::center().x, VisibleRect::center().y) ); this->addChild(test); Also I have a noBorder policy set on AppDelegate: CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder); One funny thing is that I tried to deploy the TestCpp sample project to some iOS devices and it worked reasonably well on the iPhone, but on the iPad the application was only being drawn on a small portion of the screen - just like what happened on the iPhone when I tried using the ShowAll policy.

    Read the article

  • Odd Android touch event problem

    - by user22241
    Overview When testing my game I came across a bizarre problem with my touch controls. Note this isn't related to multi-touch as I completely removed my ACTION_POINTER_UP and ACTION_POINTER_DOWN along with my ACTION_MOVE code. So I'm simply working with ACTION_UP and ACTION_DOWN now and still get the problem. The problem I have a left and right button on the left of the screen and a jump button on the right. Everything works as it should but if I touch a large area of my hand (the fleshy part at the base of the thumb for instance) onto the screen, then release it and then press one of my arrows, the sprite moves in that direction for a few seconds, and then ACTION_UP is mysteriously triggered. The sprite stops and then if I release my finger and re-apply it to an arrow, the same thing happens. This goes on and on and eventually (randomly??) stops and everything work OK again. Test device & OS Google Nexus 10 Tablet running Jellybean 4.2.2 Code //Action upon which to switch actionMask = event.getActionMasked(); //Pointer Index of the currently touching pointer pointerIndex = event.getActionIndex(); //Number of pointers (for multi-touch) pointerCount = event.getPointerCount(); //ID of the pointer currently being processed (Multitouch) pointerID = event.getPointerId(pointerIndex); switch (actionMask){ //Primary pointer down case MotionEvent.ACTION_DOWN: { //if pressing left button then set moving left if (isLeftPressed(event.getX(), event.getY())){ renderer.setSpriteLeft(); } //if pressing right button then set moving right else if (isRightPressed(event.getX(), event.getY())){ renderer.setSpriteRight(); } //if pressing jump button then set sprite jumping else if (isJumpPressed(event.getX(),event.getY())){ renderer.setSpriteState('j', true); } break; }//End of case //Primary pointer up case MotionEvent.ACTION_UP:{ //When finger leaves the screen, stop sprite's horizontal movement renderer.setSpriteStopped(); break; }

    Read the article

  • Pixel Shader, YUV-RGB Conversion failing

    - by TomTom
    I am tasked with playing back a video hthat comes in in a YUV format as an overlay in a larger game. I am not a specialist in Direct3d, so I am struggling. I managed to get a shader working and am rendering 3 textures (Y, V, U). Sadly I am totally unable to get anything like a decent image. Documentation is also failing me. I am currently loading the different data planes (Y,V,U) in three different textures: m_Textures = new Texture[3]; // Y Plane m_Textures[0] = new Texture(m_Device, w, h, 1, Usage.None, Format.L8, Pool.Managed); // V Plane m_Textures[1] = new Texture(m_Device, w2, h2, 1, Usage.None, Format.L8, Pool.Managed); // U Plane m_Textures[2] = new Texture(m_Device, w2, h2, 1, Usage.None, Format.L8, Pool.Managed); When I am rendering them as R, G and B respectively with the following code: float4 Pixel( float2 texCoord: TEXCOORD0) : COLOR0 { float y = tex2D (ytexture, texCoord); float v = tex2D (vtexture, texCoord); float u = tex2D (utexture, texCoord); //R = Y + 1.140 (V -128) //G = Y - 0.395 (U-128) - 0.581 (V-128) //B = Y + 2.028 (U-128) float r = y; //y + 1.140 * v; float g = v; //y - 0.395 * u - 0.581 * v; float b = u; //y + 2.028 * u; float4 result; result.a = 255; result.r = r; //clamp (r, 0, 255); result.g = g; //clamp (g, 0, 255); result.b = b; //clamp (b, 0, 255); return result; } Then the resulting image is - quite funny. I can see the image, but colors are totally distorted, as it should be. The formula I should apply shows up in the comment of the pixel shader, but when I do it, the resulting image is pretty brutally magenta only. This gets me to the question - when I read out an L8 texture into a float, with float y = tex2D (ytexture, texCoord); what is the range of values? The "origin" values are 1 byte, 0 to 255, and the forum I have assumes this. Naturally I am totally off when the values returned are somehow normalized. My Clamp operation at the end also will fail if for example colors in a pixel shader are normalized 0 to 1. Anyone an idea how that works? Please point me also to documentation - I have not found anything in this regard.

    Read the article

< Previous Page | 12 13 14 15 16 17  | Next Page >