Search Results

Search found 593 results on 24 pages for 'n dimensional'.

Page 11/24 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Typical collision detection

    - by marcg11
    I would like to know how is the typical collision detection of most games. For example, you control a character which can move in 2 dimensional directions (except up and down). Now lets asume he walks into a wall, most of the games depending on character angle and the BB normal face will only stop the player in one axis, but will continue moving in the other along the wall axis. How is that done? I've only managed to stop the character from going through the wall by seting the position to the last one in the past frame if the new position colllisions the bounding box. But this just makes the player stop sharply and unrealisticly.

    Read the article

  • Does 3d modeling software *choice used during asset creation affect performance at runtime

    - by user134143
    Does software used to create 3d assets (for game development specifically) have an impact on the efficiency of the program. In other words. Is it possible to reduce the operating footprint of an application merely by utilizing alternative development software during production of 3d assets. If you use two different applications to create a 3 dimensional image of a box, can one of them result in better performance if aspects of the image are identical? Sorry if this question seems vague, I am attempting to get the information I need without causing unnecessary debate over specific software choice. Thank you.

    Read the article

  • How can I use WebGL to create a tile-based multi-layer scrolling platform game?

    - by Nicholas Hill
    I've found WebGL (based on OpenGL) to be a fiendish and unforgiving framework for those learning to write HTML5-based games. Despite the presence of many examples on how to get started, I'm really struggling to understand how I could simply load a bunch of images and render them to a canvas quickly using WebGL. My specific scenario involves trying to render a map using a bespoke but simple multi-layered tile engine, where each value in a three dimensional array points to the image to use for that location in the rendered image. Think "Sonic the Hedgehog" via tilesets, tiles, maps, layers, sprites etc. Can anyone enlighten me: 1) How can I load an image that I can use as a texture in WebGL? 2) How can I dynamically select an image at run time and draw it at any co-ordinate, that I also select at run time?

    Read the article

  • Algorithm to calculate trajectories from vector field

    - by cheeesus
    I have a two-dimensional vector field, i.e., for each point (x, y) I have a vector (u, v), whereas u and v are functions of x and y. This vector field canonically defines a set of trajectories, i.e. a set of paths a particle would take if it follows along the vector field. In the following image, the vector field is depicted in red, and there are four trajectories which are partly visible, depicted in dark red: I need an algorithm which efficiently calculates some trajectories for a given vector field. The trajectories must satisfy some kind of minimum denseness in the plane (for every point in the plane we must have a 'nearby' trajectory), or some other condition to get a reasonable set of trajectories. I could not find anything useful on Google on this, and Stackexchange doesn't seem to handle the topic either. Before I start devising such an algorithm by myself: Are there any known algorithms for this problem? What is their name, for which keywords do I have to search?

    Read the article

  • Create a fast algorithm for a "weighted" median

    - by Hameer Abbasi
    Suppose we have a set S with k elements of 2-dimensional vectors, (x, n). What would be the most efficient algorithm to calculate the median of the weighted set? By "weighted set", I mean that the number x has a weight n. Here is an example (inefficient due to sorting) algorithm, where Sx is the x-part, and Sn is the n-part. Assume that all co-ordinate pairs are already arranged in Sx, with the respective changes also being done in Sn, and the sum of n is sumN: sum <= 0; i<= 0 while(sum < sumN) sum <= sum + Sn(i) ++i if(sum > sumN/2) return Sx(i) else return (Sx(i)*Sn(i) + Sx(i+1)*Sn(i+1))/(Sn(i) + Sn(i+1)) EDIT: Would this hold in two or more dimensions, if we were to calculate the median first in one dimension, then in another, with n being the sum along that dimension in the second pass?

    Read the article

  • how to deal with parallel programming

    - by nkint
    Hi. I know that parallel programming is a big resource in computer graphics, with moder machines, and mayebe a computing model that will be grow up in the near future (is this trend true?). I want to know what is the best way to deal with it. there is some practical general purpose usefulness in studying processor n-dimensional mesh, or bitonic sort in p-ram machines or it's only theory for domain specific hardware used in real particular signal elaborations of scientific simulations? Is this the best way to acquire the know how for how to become acquainted with cuda or opencl? (i'm interested in computer graphics applications) and why functional programming is so important to understand parallel computing? ps: as someone has advice me i have forked this discussion from http://stackoverflow.com/questions/4908677/how-to-deal-with-parallel-programming

    Read the article

  • How to implement the setup rules like Clash of Clan?

    - by user25959
    Now I'm already implement the setup build rules which the building could move by unit grid width and height. But the validation detection is poor efficiency. The algorithm cost me 10~12(ms) in average when I move the building. Here is my approach to that: 1.Basic Grid, it is a two dimensional array. Grid[row][column], so that I can save info for each grid. Like whether is it in occupied or excluded. 2.Exclude Space, this is a space which limit same building numbers in space.

    Read the article

  • Algorithms for positioning rectangles evenly spaced with unknown connecting lines

    - by MacGyver
    I'm new to game development, but I'm trying to figure out a good algorithm for positioning rectangles (of any width and height) in a given surface area, and connecting them with any variation of lines. Two rectangles will never have more than one line connecting them. Where would I begin working on a problem like this? This is only a 2 dimensional surface. I read about graph theory, and it seems like this is a close representation of that. The rectangles would be considered a node, and the lines connecting them would be considered an edge in graph theory.

    Read the article

  • TGA loader: reverse height

    - by aVoX
    I wrote a TGA image loader in Java which is working perfectly for files created with GIMP as long as they are saved with the option "origin" set to "Top Left" (Note: Actually TGA files are meant to be stored upside down - "Bottom Left" in GIMP). My problem is that I want my image loader to be capable of reading all different kinds of TGAs, so my question is, how do I flip the image upside down? Note that I store all image data inside a one-dimensional byte array, because OpenGL (glTexImage2D to be specific) requires it that way. Thanks in advance.

    Read the article

  • Can WebGL be used to create a tile-based multi-layer scrolling platform game?

    - by Nicholas Hill
    I've found WebGL (based on OpenGL) to be a fiendish and unforgiving framework for those learning to write HTML5-based games. Despite the presence of many examples on how to get started, I'm really struggling to understand how I could simply load a bunch of images and render them to a canvas quickly using WebGL. My specific scenario involves trying to render a map using a bespoke but simple multi-layered tile engine, where each value in a three dimensional array points to the image to use for that location in the rendered image. Think "Sonic the Hedgehog" via tilesets, tiles, maps, layers, sprites etc. Can anyone enlighten me: 1) How can I load an image that I can use as a texture in WebGL? 2) How can I dynamically select an image at run time and draw it at any co-ordinate, that I also select at run time?

    Read the article

  • TGA loader: reverse y-axis

    - by aVoX
    I've written a TGA image loader in Java which is working perfectly for files created with GIMP as long as they are saved with the option origin set to Top Left (Note: Actually TGA files are meant to be stored upside down - Bottom Left in GIMP). My problem is that I want my image loader to be capable of reading all different kinds of TGA, so my question is: How do I flip the image upside down? Note that I store all image data inside a one-dimensional byte array, because OpenGL (glTexImage2D to be specific) requires it that way. Thanks in advance.

    Read the article

  • How do I calculate the motion of 2 massive bodies in space?

    - by 1224
    I'm writing code simulating the 2-dimensional motion of two massive bodies with gravitational fields. The bodies' masses are known and I have a gravitational force equation. I know from that force I can get a differential equation for coordinates. I know that I once I solve this equation I will get the coordinates. I will need to make up some initial position and some initial velocity. I'd like to end up with a numeric solver for the ordinal differential equation for coordinates to get the formulas that I can write in code. Could someone break down how from laws and initial conditions we get to the formulas that calculate x and y at time t?

    Read the article

  • What kind of math should I be expecting in advanced programming?

    - by I_Question_Things_Deeply
    And I don't mean just space shooters and such, because in non-3D environments it's obvious that not much beyond elementary math is needed to implement. Most of the programming in 2D games is mostly going to involve basic arithmetic, algorithms for enemy AI and dimensional worlds, rotation, and maybe some Algebra as well depending on how you want to design. But I ask because I'm not really gifted with math at all. I get frustrated and worn out just by doing Pre-Algebra, so Algebra 2 and Calculus would likely be futile for me. I guess I'm not so "right-brained" when it comes down to pure numbers and math formulas, but the bad part is that I'm no art-expert either. What do you people here suppose I should do? Go along avoiding as much of the extremely difficult maths I can't fathom, or try to ease into more complex math as I excel at programming?

    Read the article

  • 2d engine with WebGL

    - by Philipp
    I am currently developing a HTML5 canvas game with a sprite-based 2d engine. The engine is working well so far, but now I thought that I could maybe add some cool graphic effects when I would re-implement the whole engine with WebGL. The whole graphic engine would stay strictly two-dimensional (think of it as a 3d world where the z coordinate of all vertices is 0.0). What I hope to gain from this is the ability to use pixel shaders to create special effects. I also think that the performance could improve. What do you think about that plan?

    Read the article

  • Sorting a multidimensional array in objective-c

    - by Zen_silence
    Hello, I'm trying to sort a multidimensional array in objective-c i know that i can sort a single dimensional array using the line of code below: NSArray *sortedArray = [someArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; I can't seem to figure out how to sort a 2D array like the one below: ( ("SOME_URL", "SOME_STORY_TITLE", "SOME_CATEGORY"), ("SOME_URL", "SOME_STORY_TITLE", "SOME_CATEGORY"), ("SOME_URL", "SOME_STORY_TITLE", "SOME_CATEGORY") ); If someone could provide me code that would sort the array by SOME_CATEGORY it would be of great help to me. Thanks, Zen_Silence

    Read the article

  • Java 2D Drawing Framework

    - by Yan Cheng CHEOK
    Currently, I am using JHotDraw https://sourceforge.net/projects/jhotdraw/ as Figures Drawing Framework in my application. JHotDraw is a two-dimensional graphics framework for structured drawing editors that is written in Java. It is based on Erich Gamma's JHotDraw, which is copyright 1996, 1997 by IFA Informatik and Erich Gamma. I was wondering, besides JHotDraw, do you try out any Java 2D Drawing Framework, which is worth a try?

    Read the article

  • selecting the pixels from an image in opencv

    - by ajith
    hi everyone, this is refined version of my previous question http://stackoverflow.com/questions/2602628/computing-matting-laplacian-matrix-of-an-image actually i want to do following operation... summation for all k|(i,j)?wk [(Ii-µk)*(Ij-µk)]...where wk is 3X3 window & µk is mean of wk...here i dont know how to select Ii & Ij separately from an image which is 2 dimensional[Iij]...or does the eqn means anything else??please someone help me..

    Read the article

  • Implement a 3D paint application: how to start?

    - by NewB
    Hello, I want to implement a paint-like application, which will enable kids to create and work with 3 dimensional objects. How can I start? What is the right approach? WPF, OpenGL, or Direct3D? (I prefer C# solutions, but C++ is OK also). Thank you all in advance! --NewB

    Read the article

  • Pretty-printing of numpy.array

    - by camillio
    Hello, I'm curious, whether there is any way to print formated numpy.arrays, e.g., in the way similar to this: x = 1.23456 print '%.3f' % x If I want to print the numpy.array of floats, it prints several decimals, often in 'scientific' format, which is rather hard to read even for low-dimensional arrays. However, numpy.array apparently has to be printed as a string, i.e., with %s. Is there any solution ready for this purpose? Many thanks in advance :-)

    Read the article

  • How can I select the pixels from an image in opencv?

    - by ajith
    This is refined version of my previous question. Actually I want to do following operation... summation for all k|(i,j)?wk [(Ii-µk)*(Ij-µk)], where wk is a 3X3 window, µk is the mean of wk, Ii & Ij are the intensities of the image at i and j. I dont know how to select Ii & Ij separately from an image which is 2 dimensional[Iij]...or does the equation mean anything else?

    Read the article

  • Try-Catch or Check Length? C# XNA

    - by Shaded
    I was just wondering which would be cheaper, using a try catch block for index out of bounds or checking the length of a multi dimensional array and comparing values? I have a feeling it's the length, since I can store the length in a variable and then just do if's which are relatively cheap. I'm just not sure how expensive try-catch is. Thanks!

    Read the article

  • Returning PHP Multi-Dimension Array to Javascript/AJAX

    - by GregH
    My understanding is that in order to return a complex PHP variable to Javascript, it should be done via AJAX and json_encode. Could somebody give me an actual example (both PHP and Javascript code) of this? Lets say we have the two-dim array in PHP: $twoDArr = array( array('Greg', 44, 'Owner'), array('Joe', 23, 'Renter'), array('Susan', 39, 'Owner'), array('John', 32, 'Renter) ); How would we return this to an analogous two dimensional array in javascript using json_encode?

    Read the article

  • How do I append to the end of the comments array in WordPress?

    - by thinkswan
    I'm trying to include something at the end of the comments array for a WordPress plugin. I currently have add_filter('comments_array', 'my_function'), where my_function($comments='') is something along the lines of: my_function($comments='') { echo 'something'; return $comments; } I obviously can't return the comments first, and echoing them doesn't work because $comments is a multi-dimensional array. Is there some way I can print the WordPress comments and then append something to them? Thanks.

    Read the article

  • how to implement k-means for simple grouping in java

    - by thandar
    Hi all, I would like to know simple k-means algorithm in java. I want to use k-means only for grouping one dimensional array not multi. For example, before grouping the array consists of 2,4,7,5,12,34,18,25 if we want four group then we got group 1: 2,4,5 group 2: 7,12 group 3: 18,25 group 4: 34

    Read the article

  • What is the fastest way to scale and display an image in Python?

    - by Knut Eldhuset
    I am required to display a two dimensional numpy.array of int16 at 20fps or so. Using Matplotlib's imshow chokes on anything above 10fps. There obviously are some issues with scaling and interpolation. I should add that the dimensions of the array are not known, but will probably be around thirty by four hundred. These are data from a sensor that are supposed to have a real-time display, so the data has to be re-sampled on the fly.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >