Search Results

Search found 7 results on 1 pages for 'pimvdb'.

Page 1/1 | 1 

  • How to gain accurate results with Painter's algorithm?

    - by pimvdb
    A while ago I asked how to determine when a face is overlapping another. The advice was to use a Z-buffer. However, I cannot use a Z-buffer in my current project and hence I would like to use the Painter's algorithm. I have no good clue as to when a surface is behind or in front of another, though. I've tried numerous methods but they all fail in edge cases, or they fail even in general cases. This is a list of sorting methods I've tried so far: Distance to midpoint of each face Average distance to each vertex of each face Average z value of each vertex Higest z value of vertices of each face and draw those first Lowest z value of vertices of each face and draw those last The problem is that a face might have a closer distance but is still further away. All these methods seem unreliable. Edit: For example, in the following image the surface with the blue point as midpoint is painted over the surface with the red point as midpoint, because the blue point is closer. However, this is because the surface of the red point is larger and the midpoint is further away. The surface with the red point should be painted over the blue one, because it is closer, whilst the midpoint distance says the opposite. What exactly is used in the Painter's algorithm to determine the order in which objects should be drawn?

    Read the article

  • 'Unblock' / 'Yellow Out' game questions

    - by pimvdb
    I would very much like to build a game that is known as 'Unblock' or 'Yellow Out'. It is a puzzle game in which the task is to move a car out of a parking space by moving other cars in certain directions. These are links where the game can be played: Yellow Out Unblock My questions concerning this game are: Is this game actually licensed? I see it's available under two names (perhaps even more). Does this mean the game idea can be used freely? Is there an article about it? I have not been able to find it on Wikipedia. I would like to gather some information about the game so as to understand more details of it. Is there some database with puzzles available? I can just check the puzzles of existing games, but that's a pain because I have to finish a level to get on to the following one. I was wondering whether there is a general list of puzzles somewhere. Thanks!

    Read the article

  • Ideas for extending tic-tac-toe game?

    - by pimvdb
    I'm building a 3D tic-tac-toe game and this is what I've implemented so far: 3D renderer with texture mapping Playing against the computer Playing online (multiplayer) Now I'm a little lost what I could add. Obviously, tic-tac-toe isn't that exciting or advanced, but I just miss something to salt it a little bit. Therefore, could anyone please suggest some ideas that would be worth implementing? Thanks!

    Read the article

  • Any risks in forwarding incoming requests to my computer? [closed]

    - by pimvdb
    I just installed EasyPHP, which is basically a combination of Apache, PHP and MySQL for dummies. I'd like to make my router forward incoming requests to my computer, so that everyone on the Internet could fetch data from my computer using the Apache server. However, I was wondering if there are many risks in this. For example: Could someone get full control of my computer this way? Is my computer more exposed to secutiry risks? Could I (practically) get DDOSed? The last question might be exaggerating, but I'm just curious. Thanks.

    Read the article

  • 'Fixed' for loop - what is more efficient?

    - by pimvdb
    I'm creating a tic-tac-toe game, and one of the functions has to iterate through each of the 9 fields (tic-tac-toe is played on a 3x3 grid). I was wondering what is more efficient (which one is perhaps faster, or what is the preferred way of scripting in such situation) - using two for nested loops like this: for(var i=0; i<3; i++) { for(var j=0; j<3; j++) { checkField(i, j); } } or hard-coding it like this: checkField(0, 0); checkField(0, 1); checkField(0, 2); checkField(1, 0); checkField(1, 1); checkField(1, 2); checkField(2, 0); checkField(2, 1); checkField(2, 2); As there are only 9 combinations, it would be perhaps overkill to use two nested for loops, but then again this is clearer to read. The for loop, however, will increment variables and check whether i and j are smaller than 3 every time as well. In this example, the time saving at least might be negligible, but what is the preferred way of coding in this case? Thanks.

    Read the article

  • $.get sends prototype functions in request URL?

    - by pimvdb
    I have some prototype functions added to Object which in my opinion were practical in certain scenarios. However, I noticed that when I executed a $.get, the prototype functions are handled as data members and are sent like http://...?prototypefunc=false. This is rather useless as I don't supply these as data members, but they are added to the query string. To be exact, I have this code: Object.prototype.in = function() { for(var i=0; i<arguments.length; i++) if(arguments[i] == this) return true; return false; } $.get('http://localhost/test.php', {'test': 'foo'}, function(text) { }); The corresponding URL constructed is: http://localhost/test.php?test=foo&in=false How can I avoid this?

    Read the article

  • Create new Array of parameter type

    - by pimvdb
    I'm trying to create a function to parse out all values in a multidimensional Array with all but one dimension given. The details are not relevant, but for this function I need to return an one-dimensional Array containing values of the same type the original multidimensional Array has. To pass any Array with any dimension to my function, I declared the type of this parameter as Array. However, how would I create a new Array of that specific type (e.g. Integer)? Currently I have the following code: Function GetRow(ByVal arr As Array) As Array Dim result As (...) 'This should be Integer() if arr contains Integers, etc. Return result End Function How do I declare the type of result to make it having the same type of values as arr? New Array is not possible as it is declared MustInherit. Thanks a lot.

    Read the article

1