Daily Archives

Articles indexed Monday June 24 2013

Page 15/22 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Multiple domains

    - by menardmam
    I got 6 domains : company.ca and company.com (because both where free, but we are a canadian company but can do business with the rest of the world). Then, we sell sportwear because of the company name is totally unknown to the world. Our product is we have bought product specific domain : chandails.ca and t-shirt.ca as well as shorts.ca and shorts.com. So those 6 domains are mine. Now what is the best way to do? Now all are 301 redirect to the main company name (.com) or make micro-site, super simple one page optimized for just shirt and one for shorts, then tell people to know more, go to the main site. Because now, I cannot really find the benefit of the search word in domain name edge if never somebody see something in that domain... I got confused and don't find strait answer to this question.

    Read the article

  • Assemble static site from templates? (don't want to reinvent the wheel)

    - by raindog308
    I have a site that is 100% static content (no php, just some javascript). There's several "blocks" like the header, menu, footer, etc. that are the same on each page. Rather than do a lot of copy/pasting, I was thinking of some kind of template system where I could run a CLI command (in php, perl, python, shell, whatever) and have it replace all the block tags with the actual block text. I did see some answers in this question, but those seem oriented towards "we provide the style and layout, you provide the text". In my case, I have everything as far as layout, css, etc. - just want to do a glorified sed. Before I invent the wheel, I was wondering if there was a tool out there already.

    Read the article

  • Trying to Host Server for External Access - Apache, VirtualBox & Portforwarding

    - by Tspoon
    Banging my head on the wall at this stage.... trying to host my Apache site on Ubuntu 12.10 with VirtualBox. Running Windows 8 host. Things I've done: Ensured Apache is listening on ports 80, 443 and 8080 (for thoroughness) tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 3355/httpd tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 3355/httpd tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3355/httpd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 681/sshd VM is using bridged network connection Assigned a static IP to my Ubuntu VM, which can be accessed fine from within network. Forwarded TCP ports 80, 8080, 443 on the static IP of VM on my router Given my VM a static NAT Address Turned off Ubuntu firewall and router firewall Read on forums that my ISP (Eircom) allow port 80 to be used And I still can't access my site using the WAN/External IP (checked internally and using CanYouSeeMe.org). It says all the ports I mentioned are closed. I'm really at a loss of what to try next... Am I missing something silly here? Note: I haven't assigned a static IP address within the router, on within the VM. And DHCP server is enabled. Is that bad?

    Read the article

  • Comparisons of Javascript 'data grids'?

    - by Joe
    I've found plenty of questions between here and StackExchange of people asking for the 'best' data grid / data table, or one that has a particular feature, and plenty of lists out there (of various ages) listing the various data grid implementations ... but is anyone aware of any matrix of what features the various solutions implement? (eg, allow shift-click to select multiple; support checkboxes for selection; can update a regular table in-place; allow editing of cells; support websql or indexeddb for local caching; which browsers they support; infinite scroll; etc.) There's a generic 'javascript framework' comparison on wikipedia, which would be the sort of thing I'm looking for, but it doesn't go into detail on data grids. (which makes sense, as so many are extensions, not core features of those frameworks, and in the case of jQuery, there's lots of 'em.)

    Read the article

  • Comparison of phrases containing the same word in Google Trends

    - by alisia123
    If I compare three phrases in google trends : house sale house white house I get the following numbers: house - 91 sale house - 3 white house - 2 The question is: Is "sale house" and "white house" already included in the number 91? It is an important question, because if it is true, than: house_except_sale_house + sale_house = 91 sale_house = 3 Which means I have to compare 88 and 3, if I compare "house" and "sale house"

    Read the article

  • Dynamically rewrite URLs upon the user's selection - is it possible?

    - by jitzo
    In my PHP based web application, there's a form that generates a URL according to the user's selection. The form has 7 different fields, each one of them affects the final URL, none of them is mandatory. The final URL can be: /field1/user_setting_of_field1/field3/user_setting_of_field3/field6/user_setting_of_field6/ or just: /field4/user_setting_of_field4 these URLs should be rewritten to- /results.php?field1=user_setting_of_field1&field3=user_setting_of_field3&field6=user_setting_of_field6 and: /results.php?field4=user_setting_of_field4 Is it possible to create a single rewrite rule that will cover these variations? I'd hate to create different rewrite rule for every possible scenario, it'll take forever... I'm currently developing the app on a Windows machine with IIS 7.5, but will eventually deploy it to an Apache server. Is it possible in both? I currently need to solve it for the IIS environment, and later on for Apache.

    Read the article

  • Will Google Analytics track URLs that just redirect?

    - by Derick Bailey
    I have a link on my site. That links goes to another URL on my site. The code on the server sees that resource being requested and redirects the browser to another website. Will Google Analytics be able to know that the user requested the URL from my server and was redirected? Specifically, I set up a /buy link on my watchmecode.net site to try and track who is clicking the "Buy & Download" button. This link/button hits my server, and my server immediately does a redirect to the PayPal processing so the user can buy the screencast. Is Google Analytics going to know that the user hit the /buy URL on my site, and track that for me? If not, what can I do to make that happen?

    Read the article

  • What is the correct way to code incoming links for SEO?

    - by DC01
    Our site is giving out 'badges' to our authors. They can post these on their personal blogs and they will serve as incoming links to our site. We want to give out the best possible code for SEO without doing anything that would get us flagged. I would like to know what you're thoughts are on the following snippet of code and if anyone has any DEFINITE advice on dos and donts with it. Also, let me know if any of it is redundant or not worth it for SEO purposes. I've kept the css inline since some of the writers would not have access to add link to external CSS. I've changed the real values, but title, alt etc would be descriptive keywords similar to our page titles etc (no overloading keywords or any of that) <div id="writer" style="width:100px;height:50px;> <h1><strong style="float:left;text-indent:-9999px;overflow:hidden;margin:0;padding:0;">articles on x,y,z</strong> <a href="http://www.site.com/link-to-author" title="site description"> <img style="border:none" src="http://www.site.com/images/badge.png" alt="description of articles" title="View my published work on site.com"/> </a> </h1></div>

    Read the article

  • Converting openGl code to DirectX

    - by Fredrik Boston Westman
    First of all, this is kind of a follow up question on @byte56 excellent anwser on this question concerning picking algorithms. I'm trying to convert one of his code examples to directX 11 however I have run in to some problems ( I can pick but the picking is way off), and I wanted to make sure I had done it rigth before moving on and checking the rest of my code. I am not that familiar with openGl but I can imagine openGl has diffrent coordinations systems, and functions that alters how you must implement to code abit. This is his code example: public Ray GetPickRay() { int mouseX = Mouse.getX(); int mouseY = WORLD.Byte56Game.getHeight() - Mouse.getY(); float windowWidth = WORLD.Byte56Game.getWidth(); float windowHeight = WORLD.Byte56Game.getHeight(); //get the mouse position in screenSpace coords double screenSpaceX = ((float) mouseX / (windowWidth / 2) - 1.0f) * aspectRatio; double screenSpaceY = (1.0f - (float) mouseY / (windowHeight / 2)); double viewRatio = Math.tan(((float) Math.PI / (180.f/ViewAngle) / 2.00f))* zoomFactor; screenSpaceX = screenSpaceX * viewRatio; screenSpaceY = screenSpaceY * viewRatio; //Find the far and near camera spaces Vector4f cameraSpaceNear = new Vector4f((float) (screenSpaceX * NearPlane), (float) (screenSpaceY * NearPlane), (float) (-NearPlane), 1); Vector4f cameraSpaceFar = new Vector4f((float) (screenSpaceX * FarPlane), (float) (screenSpaceY * FarPlane), (float) (-FarPlane), 1); //Unproject the 2D window into 3D to see where in 3D we're actually clicking Matrix4f tmpView = Matrix4f(view); Matrix4f invView = (Matrix4f) tmpView.invert(); Vector4f worldSpaceNear = new Vector4f(); Matrix4f.transform(invView, cameraSpaceNear, worldSpaceNear); Vector4f worldSpaceFar = new Vector4f(); Matrix4f.transform(invView, cameraSpaceFar, worldSpaceFar); //calculate the ray position and direction Vector3f rayPosition = new Vector3f(worldSpaceNear.x, worldSpaceNear.y, worldSpaceNear.z); Vector3f rayDirection = new Vector3f(worldSpaceFar.x - worldSpaceNear.x, worldSpaceFar.y - worldSpaceNear.y, worldSpaceFar.z - worldSpaceNear.z); rayDirection.normalise(); return new Ray(rayPosition, rayDirection); } All rigths reserved to him of course This is my DirectX 11 code : void GraphicEngine::pickRayVector(float mouseX, float mouseY,XMVECTOR& pickRayInWorldSpacePos, XMVECTOR& pickRayInWorldSpaceDir) { float PRVecX, PRVecY; float nearPlane = 0.1f; float farPlane = 200.0f; floar viewAngle = 0.4 * 3.14; PRVecX = ((( 2.0f * mouseX) / ClientWidth ) - 1 ) * tan((viewAngle)/2); PRVecY = (1-(( 2.0f * mouseY) / ClientHeight)) * tan((viewAngle)/2); XMVECTOR cameraSpaceNear = XMVectorSet(PRVecX * nearPlane,PRVecY * nearPlane, -nearPlane, 1.0f); XMVECTOR cameraSpaceFar = XMVectorSet(PRVecX * farPlane,PRVecY * farPlane, -farPlane, 1.0f); // Transform 3D Ray from View space to 3D ray in World space XMMATRIX invMat; XMVECTOR matInvDeter; invMat = XMMatrixInverse(&matInvDeter, cam->getCameraView()); //Inverse of View Space matrix is World space matrix XMVECTOR worldSpaceNear = XMVector3TransformCoord(cameraSpaceNear, invMat); XMVECTOR worldSpaceFar = XMVector3TransformCoord(cameraSpaceFar, invMat); pickRayInWorldSpacePos = worldSpaceNear; pickRayInWorldSpaceDir = worldSpaceFar-worldSpaceNear; pickRayInWorldSpaceDir = XMVector3Normalize(pickRayInWorldSpaceDir); } A couple of notes: The mouse coordinates are already converted so that the top left corner of the client window would be (0,0) and the bottom rigth (800,600) ( or whatever resolution you would have) I hadn't used any far or near plane before, so i just made some arbitrary number up for them. To my understanding it shouldnt matter as long as the object you are trying to pick is in between the range of thoese numbers The viewAngle is the same angle that I used when setting the camera view with XMMatrixPerspectiveFovLH , I just hadn't made it a member variable of my Camera class yet. I removed the variable aspectRation and zoomFactor because I assumed that they where related to some specific function of his game. Now I'm not sure, but I think the problems lies either withing the mouse to viewspace conversion, maby that we use diffrent coordinations systems. Either that or how i transform the matrixes in the the end, because i know order is important when it comes to matrixes. Any help is appriciated! Thanks in advance. Edit: One more note, my code is in c++

    Read the article

  • How or why would this mechanic (not) work to bring game balance to a singleplayer RPG? [closed]

    - by 0xFFF1
    Mechanic details The player, the monsters, and the merchants act as three separate parties. The player needs to beat up monsters for exp points and resources to sell and to buy potions from merchants to continue to fight. The monsters need healing and reviving to survive (also bought from merchants) and the merchants need potion ingredients from the player and the monsters to make potions to sell. These potions are only able to be processed in such bulk by merchants thus their potions would be cheaper than making them yourself. Only the monsters can farm ingredients in bulk. Only the player is or has to be overly aggressive (in bulk). Monsters can farm and produce "Level up candies" that do the work of exp. they are eaten right away after they are made and are never stockpiled or held for fear of the player and merchants who want to sell to the player. The monsters will defend themselves. Reviving is very expensive. The merchants can be found either with a concerned expression or a grinning expression based on how much profit they are making compared to their morale standing. The economies of each monster town and merchant city are distinct but interconnected. Magic Swords are worth a lot. So what I need to know is what concerns would there be to design a game around this mechanic and/or design this mechanic around a developing game. which would fare better? Is game balance an issue here? (how strong the monsters get or how quickly they die off based on the player's input into the system), Or is game balance solely in the hands of the player? (he decides if he overkills monsters or get underleveled.) What do I need to think about to make sure it isn't too easy or too hard to swing the amount/strength of monsters compared to the player and the amount of profit the merchants get vs the player. Would indicating how out of whack things are getting in game help with this?

    Read the article

  • OpenGL: Attempt to allocate a texture to big for the current hardware

    - by AnonymousMan
    I'm getting the following error: java.io.IOException: Attempt to allocate a texture to big for the current hardware at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:320) at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:254) at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:200) at org.newdawn.slick.opengl.TextureLoader.getTexture(TextureLoader.java:64) at org.newdawn.slick.opengl.TextureLoader.getTexture(TextureLoader.java:24) The image I'm trying to use is 128x128. System.out.println(GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE)); I get: 32. 32??!! My graphics card is AMD Radeon HD 7970M with 2048 MB GDDR5 RAM, I can run all the latest games in 1080p and 60fps with no problem, and those textures sure as hell doesn't look like they are 32x32 pixels to me! How can I fix this? -- Edit: Here's the chaos code I use to init OpenGL: Display.setDisplayMode(new DisplayMode(500,500)); Display.create(); if (!GLContext.getCapabilities().OpenGL11) { throw new Exception("OpenGL 1.1 not supported."); } Display.setTitle("Game"); glMatrixMode(GL_PROJECTION); glLoadIdentity(); GLU.gluPerspective(45, 1, 0.1f, 5000); Mouse.setGrabbed(true); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glEnable(GL_TEXTURE_2D); glClearColor(0, 0, 0, 0); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_POINT_SMOOTH); glEnable(GL_LINE_SMOOTH); glEnable(GL_POLYGON_SMOOTH); glEnable(GL_POLYGON_OFFSET_FILL); glShadeModel(GL_SMOOTH); Display is a LWJGL thing, it makes the OpenGL context and the window. Anyway, I don't think there's anything in the init code that can help me but you never know...

    Read the article

  • Particle trajectory smoothing: where to do the simulation?

    - by nkint
    I have a particle system in which I have particles that are moving to a target and the new targets are received via network. The list of new target are some noisy coordinates of a moving target stored in the server that I want to smooth in the client. For doing the smoothing and the particle I wrote a simple particle engine with standard euler integration model. So, my pseudo code is something like that: # pseudo code class Particle: def update(): # do euler motion model integration: # if the distance to the target is more than a limit # add a new force to the accelleration # seeking the target, # and add the accelleration to velocity # and velocity to the position positionHistory.push_back(position); if history.length > historySize : history.pop_front() class ParticleEngine: particleById = dict() # an associative array # where the keys are the id # and particle istances are sotred as values # this method is called each time a new tcp packet is received and parsed def setNetTarget(int id, Vec2D new_target): particleById[id].setNewTarget(new_target) # this method is called each new frame def draw(): for p in particleById.values: p.update() beginVertex(LINE_STRIP) for v in p.positionHistory: vertex(v.x, v.y) endVertex() The new target that are arriving are noisy but setting some accelleration/velocity parameters let the particle to have a smoothed trajectories. But if a particle trajectory is a circle after a while the particle position converge to the center (a normal behaviour of euler integration model). So I decided to change the simulation and use some other interpolation (spline?) or smooth method (kalman filter?) between the targets. Something like: switch( INTERPOLATION_MODEL ): case EULER_MOTION: ... case HERMITE_INTERPOLATION: ... case SPLINE_INTERPOLATION: ... case KALMAN_FILTER_SMOOTHING: ... Now my question: where to write the motion simulation / trajectory interpolation? In the Particle? So I will have some Particle subclass like ParticleEuler, ParticleSpline, ParticleKalman, etc..? Or in the particle engine?

    Read the article

  • How to draw tile edges when you don't know where they're going.

    - by Skeith
    This is more of an art question than a programing one but still game development. I have a tile engine that makes a map randomly from tiles, each tile is a square 3x3 grid. The problem is that while the elements on each tile work well together such as having forests along the top three squares and grass on the other 6, the engine could put the forrests against anything such as rivers, grass, mountains or more forest. how can i draw the edges of the tiles so the look good no matter what they are places against ?

    Read the article

  • C# and Unity - Learning to Develop a game by developing the game I want to develop

    - by 97s
    So I am pretty new to C#, I have some python and javascript experience, but nothing substantial. I have read a lot about C# and Unity and I know they are the tools I want to use. My question is: Should I be reading books about C# or should I just start hacking in unity and piecing the game together part by part? Right now I am going through the book, HeadFirst C#, and it is very good, but I taught myself web design and javascript by just creating and hacking until I got the results I wanted then looked at other code to see ways they did it and improved my code. The issue is that with the browser I got immediate results and it was all under one roof, where developing games is a completely different monster. I am just wondering if my time would be better spent buying a book that uses C# to teach you unity, and doing that instead, or if the time spent in HeadFirst book is going to be valuable. Thanks a ton, I am having difficulties using my time, and I just want to maximize it as I don't have a lot of free time. Edit: Hopefully this isn't to broad? If it is, I will delete and go elsewhere just let me know. Thanks.

    Read the article

  • Displaying performance data per engine subsystem

    - by liortal
    Our game (Android based) traces how long it takes to do the world logic updates, and how long it takes to a render a frame to the device screen. These traces are collected every frame, and displayed at a constant interval (currently every 1 second). I've seen games where on-screen data of various engine subsystems is displayed, with the time they consume (either in text) or as horizontal colored bars. I am wondering how to implement such a feature?

    Read the article

  • How to prevent "underwater sight" in games

    - by CPP_Person
    In many games where the player can go underwater, it seems like when you look where the top half of the screen is in the air, and the bottom half the screen is in the water, it's almost like the water doesn't exist and the player is... flying slowly with water sounds? Is there a logical way to solve this? An algorithm? Doesn't seem like any solution has come up yet since many games still have this. I don't want to make the same mistake.

    Read the article

  • What is the purpose of bitdepth for the several components of the framebuffer in glfwWindowHint function of GLFW3?

    - by Rui d'Orey
    I would like to know what are the following "framebuffer related hints" of GLFW3 function glfwWindowHint : GLFW_RED_BITS GLFW_GREEN_BITS GLFW_BLUE_BITS GLFW_ALPHA_BITS GLFW_DEPTH_BITS GLFW_STENCIL_BITS What is the purpose of this? Usually their default values are enough? Where are those bits stored? In a buffer in the GPU? What do they affect? And by that I mean in what way Thank you in advance!

    Read the article

  • Optimizing drawing of cubes

    - by Christian Frantz
    After googling for hours I've come to a few conclusions, I need to either rewrite my whole cube class, or figure out how to use hardware instancing. I can draw up to 2500 cubes with little lag, but after that my fps drops. Is there a way I can use my class for hardware instancing? Or would I be better off rewriting my class for optimization? public class Cube { public GraphicsDevice device; public VertexBuffer cubeVertexBuffer; public Cube(GraphicsDevice graphicsDevice) { device = graphicsDevice; var vertices = new List<VertexPositionTexture>(); BuildFace(vertices, new Vector3(0, 0, 0), new Vector3(0, 1, 1)); BuildFace(vertices, new Vector3(0, 0, 1), new Vector3(1, 1, 1)); BuildFace(vertices, new Vector3(1, 0, 1), new Vector3(1, 1, 0)); BuildFace(vertices, new Vector3(1, 0, 0), new Vector3(0, 1, 0)); BuildFaceHorizontal(vertices, new Vector3(0, 1, 0), new Vector3(1, 1, 1)); BuildFaceHorizontal(vertices, new Vector3(0, 0, 1), new Vector3(1, 0, 0)); cubeVertexBuffer = new VertexBuffer(device, VertexPositionTexture.VertexDeclaration, vertices.Count, BufferUsage.WriteOnly); cubeVertexBuffer.SetData<VertexPositionTexture>(vertices.ToArray()); } private void BuildFace(List<VertexPositionTexture> vertices, Vector3 p1, Vector3 p2) { vertices.Add(BuildVertex(p1.X, p1.Y, p1.Z, 1, 0)); vertices.Add(BuildVertex(p1.X, p2.Y, p1.Z, 1, 1)); vertices.Add(BuildVertex(p2.X, p2.Y, p2.Z, 0, 1)); vertices.Add(BuildVertex(p2.X, p2.Y, p2.Z, 0, 1)); vertices.Add(BuildVertex(p2.X, p1.Y, p2.Z, 0, 0)); vertices.Add(BuildVertex(p1.X, p1.Y, p1.Z, 1, 0)); } private void BuildFaceHorizontal(List<VertexPositionTexture> vertices, Vector3 p1, Vector3 p2) { vertices.Add(BuildVertex(p1.X, p1.Y, p1.Z, 0, 1)); vertices.Add(BuildVertex(p2.X, p1.Y, p1.Z, 1, 1)); vertices.Add(BuildVertex(p2.X, p2.Y, p2.Z, 1, 0)); vertices.Add(BuildVertex(p1.X, p1.Y, p1.Z, 0, 1)); vertices.Add(BuildVertex(p2.X, p2.Y, p2.Z, 1, 0)); vertices.Add(BuildVertex(p1.X, p1.Y, p2.Z, 0, 0)); } private VertexPositionTexture BuildVertex(float x, float y, float z, float u, float v) { return new VertexPositionTexture(new Vector3(x, y, z), new Vector2(u, v)); } public void Draw(BasicEffect effect) { foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Apply(); device.SetVertexBuffer(cubeVertexBuffer); device.DrawPrimitives(PrimitiveType.TriangleList, 0, cubeVertexBuffer.VertexCount / 3); } } } The following class is a list that draws the cubes. public class DrawableList<T> : DrawableGameComponent { private BasicEffect effect; private ThirdPersonCam camera; private class Entity { public Vector3 Position { get; set; } public Matrix Orientation { get; set; } public Texture2D Texture { get; set; } } private Cube cube; private List<Entity> entities = new List<Entity>(); public DrawableList(Game game, ThirdPersonCam camera, BasicEffect effect) : base(game) { this.effect = effect; cube = new Cube(game.GraphicsDevice); this.camera = camera; } public void Add(Vector3 position, Matrix orientation, Texture2D texture) { entities.Add(new Entity() { Position = position, Orientation = orientation, Texture = texture }); } public override void Draw(GameTime gameTime) { foreach (var item in entities) { effect.VertexColorEnabled = false; effect.TextureEnabled = true; effect.Texture = item.Texture; Matrix center = Matrix.CreateTranslation(new Vector3(-0.5f, -0.5f, -0.5f)); Matrix scale = Matrix.CreateScale(1f); Matrix translate = Matrix.CreateTranslation(item.Position); effect.World = center * scale * translate; effect.View = camera.view; effect.Projection = camera.proj; effect.FogEnabled = true; effect.FogColor = Color.CornflowerBlue.ToVector3(); effect.FogStart = 1.0f; effect.FogEnd = 50.0f; cube.Draw(effect); } base.Draw(gameTime); } } } There are probably many reasons that my fps is so slow, but I can't seem to figure out how to fix it. I've looked at techcraft as well, but what I have is too specific to what I want the outcome to be to just rewrite everything from scratch

    Read the article

  • How to make the Angry Birds "shot arch" dotted line? [duplicate]

    - by unexpected62
    This question already has an answer here: Show path of a body of where it should go after linear impulse is applied 2 answers I am making a game that includes 2D projectile flight paths like that of Angry Birds. Angry Birds employs the notion that a previous shot is shown with a dotted line "arch" showing the player where that last shot went. I think recording that data is simple enough once a shot is fired, but in my game, I want to show it preemptively, ie: before the shot. How would I go about calculating this dotted line? The other caveat is I have wind in my game. How can you determine a projectile preemptively when wind will affect it too? This seems like a pretty tough problem. My wind right now just applies a constant force every step of animation in the direction of the wind flow. I'm using Box2D and AndEngine if it matters.

    Read the article

  • Grid Based Lighting in XNA/Monogame

    - by sm81095
    I know that questions like this have been asked many times, but I have not found one exactly like this yes. I have implemented a top-down grid based world in Monogame, and am starting on the lighting system soon. How I want to do lighting is to have a grid that is 4 times wider and higher, basically splitting each world tile into a 4x4 system of "subtiles". I would like to use a flow like system to spread light across the tiles by reducing the light by a small amount each time. This is kind of the effect I was going for: http://i.imgur.com/rv8LCxZ.png The black grid lines are the light grid, and the red lines are the actual tile grid, and the light drop-off is very exaggerated. I plan to render the world by drawing the unlit grid to a separate RenderTarget2D, then rendering the lighting grid to a separate target and overlaying the two. Basically, my questions are: What would be the algorithm for a flow style lighting system like this? Would there be a more efficient way of rendering this? How would I handle the darkening of the light with colors, reducing the RGB values in each grid, or reducing the alpha in each grid, assuming that I render the light map over the grid using blending? Even assuming the former are possible, what BlendState would I use for that?

    Read the article

  • XNA Level Select Menu

    - by user29901
    I'll try to explain this the best I can. I'm trying to create a level select menu for a game I'm making. The menu is basically a group of blocks numbered 1-16, similar to something like the Angry Birds menu. What I've done is created a cursor, basically just an outline to surround a block, that the user can move to select what level they want to play. What I want it do is move from block to block instead of simply moving around on the X and Y axes as it does now. So my question is, how can I get the cursor (highLight in the below code) to move from block to block(destinationRectangle1 etc. in the code)? /// Field for the "cursor" Vector2 highLightPos = new Vector2(400, 200); ///This is the Update code KeyboardState keyBoardState = Keyboard.GetState(); if (keyBoardState.IsKeyDown(Keys.Up)) highLightPos.Y--; if (keyBoardState.IsKeyDown(Keys.Down)) highLightPos.Y++; if (keyBoardState.IsKeyDown(Keys.Right)) highLightPos.X++; if (keyBoardState.IsKeyDown(Keys.Left)) highLightPos.X--; /// This is the draw code SpriteBatch spriteBatch = ScreenManager.SpriteBatch; Rectangle screenRectangle = new Rectangle(0, 0, 1280, 720); Rectangle destinationRectangle1 = new Rectangle(400, 200, 64, 64); Rectangle frameRectangle1 = new Rectangle(0, 0, 64, 64); Rectangle destinationRectangle2 = new Rectangle(500, 200, 64, 64); Rectangle frameRectangle2 = new Rectangle(64, 0, 64, 64); Rectangle destinationRectangle3 = new Rectangle(600, 200, 64, 64); Rectangle frameRectangle3 = new Rectangle(128, 0, 64, 64); Rectangle destinationRectangle4 = new Rectangle(700, 200, 64, 64); Rectangle frameRectangle4 = new Rectangle(192, 0, 64, 64); Rectangle destinationRectangle5 = new Rectangle(800, 200, 64, 64); Rectangle frameRectangle5 = new Rectangle(256, 0, 64, 64); Rectangle destinationRectangle6 = new Rectangle(400, 300, 64, 64); Rectangle frameRectangle6 = new Rectangle(320, 0, 64, 64); Rectangle destinationRectangle7 = new Rectangle(500, 300, 64, 64); Rectangle frameRectangle7 = new Rectangle(384, 0, 64, 64); Rectangle destinationRectangle8 = new Rectangle(600, 300, 64, 64); Rectangle frameRectangle8 = new Rectangle(448, 0, 64, 64); Rectangle destinationRectangle9 = new Rectangle(700, 300, 64, 64); Rectangle frameRectangle9 = new Rectangle(0, 64, 64, 64); Rectangle destinationRectangle10 = new Rectangle(800, 300, 64, 64); Rectangle frameRectangle10 = new Rectangle(64, 64, 64, 64); Rectangle destinationRectangle11 = new Rectangle(400, 400, 64, 64); Rectangle frameRectangle11 = new Rectangle(128, 64, 64, 64); Rectangle destinationRectangle12 = new Rectangle(500, 400, 64, 64); Rectangle frameRectangle12 = new Rectangle(192, 64, 64, 64); Rectangle destinationRectangle13 = new Rectangle(600, 400, 64, 64); Rectangle frameRectangle13 = new Rectangle(256, 64, 64, 64); Rectangle destinationRectangle14 = new Rectangle(700, 400, 64, 64); Rectangle frameRectangle14 = new Rectangle(320, 64, 64, 64); Rectangle destinationRectangle15 = new Rectangle(800, 400, 64, 64); Rectangle frameRectangle15 = new Rectangle(384, 64, 64, 64); Rectangle destinationRectangle16 = new Rectangle(600, 500, 64, 64); Rectangle frameRectangle16 = new Rectangle(448, 64, 64, 64); spriteBatch.Begin(); spriteBatch.Draw(forestBG, screenRectangle, Color.White); spriteBatch.Draw(highLight, highLightPos, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle1, frameRectangle1, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle2, frameRectangle2, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle3, frameRectangle3, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle4, frameRectangle4, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle5, frameRectangle5, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle6, frameRectangle6, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle7, frameRectangle7, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle8, frameRectangle8, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle9, frameRectangle9, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle10, frameRectangle10, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle11, frameRectangle11, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle12, frameRectangle12, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle13, frameRectangle13, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle14, frameRectangle14, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle15, frameRectangle15, Color.White); spriteBatch.Draw(levelSelectTiles, destinationRectangle16, frameRectangle16, Color.White); spriteBatch.End(); PS, I'm aware that this code is probably inefficient, cumbersome or that there's a better way to draw parts of a tile sheet. Any suggestions would be appreciated.

    Read the article

  • creating bounding box list

    - by Christian Frantz
    I'm trying to create a list of bounding boxes for each cube drawn, so I can use the boxes to intersect with a ray that my mouse position is casting, but I have no idea how. I've created a list that stores the boxes, but how am I getting the values from each box? for (int x = 0; x < mapHeight; x++) { for (int z = 0; z < mapWidth; z++) { cubes.Add(new Vector3(x, map[x, z], z), Matrix.Identity, grass); boxList.Add(something here); } } public Cube(GraphicsDevice graphicsDevice) { device = graphicsDevice; var vertices = new List<VertexPositionTexture>(); BuildFace(vertices, new Vector3(0, 0, 0), new Vector3(0, 1, 1)); BuildFace(vertices, new Vector3(0, 0, 1), new Vector3(1, 1, 1)); BuildFace(vertices, new Vector3(1, 0, 1), new Vector3(1, 1, 0)); BuildFace(vertices, new Vector3(1, 0, 0), new Vector3(0, 1, 0)); BuildFaceHorizontal(vertices, new Vector3(0, 1, 0), new Vector3(1, 1, 1)); BuildFaceHorizontal(vertices, new Vector3(0, 0, 1), new Vector3(1, 0, 0)); cubeVertexBuffer = new VertexBuffer(device, VertexPositionTexture.VertexDeclaration, vertices.Count, BufferUsage.WriteOnly); cubeVertexBuffer.SetData<VertexPositionTexture>(vertices.ToArray()); } There aren't any clearly defined variables for the bounds of each cube created, so where do I create the bounding box from?

    Read the article

  • OpenGL and gluUnProject, 3d object following mouse

    - by Robert
    i have a 3d object and i want him to "follow" my mouse position, so i use gluUnProject function to convert screen coordinates to 3d world coordinates and i translate this object with the new coordinates. Its working but i have a problem, my object can follow my mouse but he is moving extremely fast, when i move my mouse a little bit(something like 2 pixels), its moving extremly fast in the 3d world. I want something like that : http://www.youtube.com/watch?v=90zS8SVUAIY (red circle following mouse). Thanks for your help.

    Read the article

  • Playing part of a sfx audio file in HTML5 using WebAudio

    - by Matthew James Davis
    I have compiled all of my sound effects into one sequenced .ogg file. I have the start and stop times for each sound effect. How do I play the individual effects? That is, how do I play part of an audio file. More specificially, I've created a dictionary { 'sword_hit': { src: 'sfx.ogg', start: 265, // ms length: 212 // ms } } that my play_sound() function can use to look up 'sword_hit' and play the correct audio file at the correct start time for the correct duration. I simply need to know how to tell the WebAudio API to start playing at start ms and only play for length ms.

    Read the article

  • 3dsmax crashes when exporting

    - by odoc
    I'm trying to export a (.max) file to openCOLLADA (.dae). Whenever I do this, 3dsmax crashes and produces this error: An error has occurred and the application will now close. No scene changes have occurred since your last save. 3dsmax then crashes but the COLLADA file is still produced. Whenever I try opening this COLLADA file in other software though, it comes up with a bad mesh data error. This is leading me to think that it wasn't exported correctly out of 3dsmax. Any advice?

    Read the article

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