Search Results

Search found 7897 results on 316 pages for 'generate'.

Page 81/316 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Getting a mirrored mesh from my data structure

    - by Steve
    Here's the background: I'm in the beginning stages of an RTS game in Unity. I have a procedurally generated terrain with a perlin-noise height map, as well as a function to generate a river. The problem is that the graphical creation of the map is taking the data structure of the map and rotating it by 180 degrees. I noticed this problem when I was creating my rivers. I would set the River's height to flat, and noticed that the actual tiles that were flat in the graphical representation were flipped and mirrored. Here's 3 screenshots of the map from different angles: http://imgur.com/a/VLHHq As you can see, if you flipped (graphically) the river by 180 degrees on the z axis, it would fit where the terrain is flattened. I have a suspicion it is being caused by a misunderstanding on my part of how vertices work. Alas, here is a snippet of the code that is used: This code here creates a new array of Tile objects, which hold the information for each tile, including its type, coordinate, height, and it's 4 vertices public DTileMap (int size_x, int size_y) { this.size_x = size_x; this.size_y = size_y; //Initialize Map_Data Array of Tile Objects map_data = new Tile[size_x, size_y]; for (int j = 0; j < size_y; j++) { for (int i = 0; i < size_x; i++) { map_data [i, j] = new Tile (); map_data[i,j].coordinate.x = (int)i; map_data[i,j].coordinate.y = (int)j; map_data[i,j].vertices[0] = new Vector3 (i * GTileMap.TileMap.tileSize, map_data[i,j].Height, -j * GTileMap.TileMap.tileSize); map_data[i,j].vertices[1] = new Vector3 ((i+1) * GTileMap.TileMap.tileSize, map_data[i,j].Height, -(j) * GTileMap.TileMap.tileSize); map_data[i,j].vertices[2] = new Vector3 (i * GTileMap.TileMap.tileSize, map_data[i,j].Height, -(j-1) * GTileMap.TileMap.tileSize); map_data[i,j].vertices[3] = new Vector3 ((i+1) * GTileMap.TileMap.tileSize, map_data[i,j].Height, -(j-1) * GTileMap.TileMap.tileSize); } } This code sets the river tiles to height 0 foreach (Tile t in map_data) { if (t.realType == "Water") { t.vertices[0].y = 0f; t.vertices[1].y = 0f; t.vertices[2].y = 0f; t.vertices[3].y = 0f; } } And below is the code to generate the actual graphics from the data: public void BuildMesh () { DTileMap.DTileMap map = new DTileMap.DTileMap (size_x, size_z); int numTiles = size_x * size_z; int numTris = numTiles * 2; int vsize_x = size_x + 1; int vsize_z = size_z + 1; int numVerts = vsize_x * vsize_z; // Generate the mesh data Vector3[] vertices = new Vector3[ numVerts ]; Vector3[] normals = new Vector3[numVerts]; Vector2[] uv = new Vector2[numVerts]; int[] triangles = new int[ numTris * 3 ]; int x, z; for (z=0; z < vsize_z; z++) { for (x=0; x < vsize_x; x++) { normals [z * vsize_x + x] = Vector3.up; uv [z * vsize_x + x] = new Vector2 ((float)x / size_x, 1f - (float)z / size_z); } } for (z=0; z < vsize_z; z+=1) { for (x=0; x < vsize_x; x+=1) { if (x == vsize_x - 1 && z == vsize_z - 1) { vertices [z * vsize_x + x] = DTileMap.DTileMap.map_data [x - 1, z - 1].vertices [3]; } else if (z == vsize_z - 1) { vertices [z * vsize_x + x] = DTileMap.DTileMap.map_data [x, z - 1].vertices [2]; } else if (x == vsize_x - 1) { vertices [z * vsize_x + x] = DTileMap.DTileMap.map_data [x - 1, z].vertices [1]; } else { vertices [z * vsize_x + x] = DTileMap.DTileMap.map_data [x, z].vertices [0]; vertices [z * vsize_x + x+1] = DTileMap.DTileMap.map_data [x, z].vertices [1]; vertices [(z+1) * vsize_x + x] = DTileMap.DTileMap.map_data [x, z].vertices [2]; vertices [(z+1) * vsize_x + x+1] = DTileMap.DTileMap.map_data [x, z].vertices [3]; } } } } for (z=0; z < size_z; z++) { for (x=0; x < size_x; x++) { int squareIndex = z * size_x + x; int triOffset = squareIndex * 6; triangles [triOffset + 0] = z * vsize_x + x + 0; triangles [triOffset + 2] = z * vsize_x + x + vsize_x + 0; triangles [triOffset + 1] = z * vsize_x + x + vsize_x + 1; triangles [triOffset + 3] = z * vsize_x + x + 0; triangles [triOffset + 5] = z * vsize_x + x + vsize_x + 1; triangles [triOffset + 4] = z * vsize_x + x + 1; } } // Create a new Mesh and populate with the data Mesh mesh = new Mesh (); mesh.vertices = vertices; mesh.triangles = triangles; mesh.normals = normals; mesh.uv = uv; // Assign our mesh to our filter/renderer/collider MeshFilter mesh_filter = GetComponent<MeshFilter> (); MeshCollider mesh_collider = GetComponent<MeshCollider> (); mesh_filter.mesh = mesh; mesh_collider.sharedMesh = mesh; calculateMeshTangents (mesh); BuildTexture (map); } If this looks familiar to you, its because i got most of it from Quill18. I've been slowly adapting it for my uses. And please include any suggestions you have for my code. I'm still in the very early prototyping stage.

    Read the article

  • Random enemy placement on a 2d grid

    - by Robb
    I want to place my items and enemies randomly (or as randomly as possible). At the moment I use XNA's Random class to generate a number between 800 for X and 600 for Y. It feels like enemies spawn more towards the top of the map than in the middle or bottom. I do not seed the generator, maybe that is something to consider. Are there other techniques described that can improve random enemy placement on a 2d grid?

    Read the article

  • SEO Marketing With Keywords

    When I begin my SEO marketing campaign, keyword research is very important. This is how I'll set up my keyword campaign. I'll start out with 50 terms to use. Then I'll look at the search volume to see what kind of traffic I can generate to my web site.

    Read the article

  • These Are Obvious Advantages and Disadvantages to Static As Well As Dynamic Sites

    You can find mostly these types of websites that are mostly developed these days and they are static sites as well as dynamic sites because there is various importance of each of these techniques. Which one you are going to opt should be as per your requirements for your website and generally if you want a website that is going to generate revenue with PPC or affiliate programs then you should go with a static site but in case you wish to create a website that will be more appealing to audience with more interactivity then a dynamic site...

    Read the article

  • Be Lucrative Using Search Engine Optimization (SEO)

    Another way to make money online is through Search Engine Optimization (SEO). This technique influences different search engines such as Google, Yahoo, Bing and Live. This is usually done to help generate traffic into their websites equating to potential profit. The SEO technique has helped many into their success online. There are many contributing factors that influence your ranking in Google, but I will not discuss that here as there are far too many to rank.

    Read the article

  • A Look at Keyword Search Optimization

    With the great influence of the Internet on a growing number of consumers these days, online marketing is now considered one of the best, if not the best, way to promote a business. This strategy offers greater possibilities for a business to be known enough to generate increasing revenues. Pinpointing the exact right techniques, however, will take some brainstorming which could be a critical stage because it requires a lot of time for marketers to determine on which tricks are, indeed, going to work and which will be a waste of time.

    Read the article

  • Search Engine Optimization Experts

    What are search engine optimization experts? This is a specialist that has a profound knowledge about search engines and they also have the ability to bring a website top ranking by applying targeted keywords as well as using various methods to generate higher sales.

    Read the article

  • Need to find a find a fast/multi-user database program

    - by user65961
    Our company is currently utilizing Excel and have been encountering a series of issues for starters we have multiple users sharing this application. We utilize it write our schedules for our employees and generate staffing levels. May someone give me please or inform me what are the pros and cons of this program and offer suggestions for another database that allows multiple users to share and also give the pros and cons need something that will hold massive data and allow sharing, protecting capabilities.

    Read the article

  • Term for a single C++ endpoint/object file

    - by Qix
    I have heard several terms for a C++ "Codepoint" (which is what I've heard used the most often), or a .cpp file that is compiled into an object file. For instance, .cpp files can include other .cpp files (or any other file, really, so long as it compiles), but during compilation, there is really only one 'main' code file that is used/generated. I know there is a widely accepted term, I just can't recall what it is. What is the accepted term for the final .c/.cpp file used to generate an object file?

    Read the article

  • Benefits of SEO & SEM

    Search engine optimization is the service that allows the website owners to generate more and more traffic to their web portal. By using this facility, you can easily produce internal links as well.

    Read the article

  • Website Development and Its Promotion

    Website development comprises a lot more than simply designing a page layout and writing down the codes to make it work on the world wide web (WWW). The main objective of making a website in the first place is for it to be viewed by all and sundry and in turn to generate the right amount of business.

    Read the article

  • What is a useful pattern to maintaining an object state in a one to many relationship?

    - by ahenderson
    I am looking for a design for my application, here are the players(classes) involved. struct Transform { // Uses a matrix to transform the position. // Also acts acts as the state of a Dialog. Position transform(Position p); //other methods. }; struct Dialog { // There are multiple dialog for the user to transform the output. Transform& t; void ChangeTranformation(){t.rotate(360);} } struct Algorithm { //gives us a position based on an implementation. For example this can return points on a circle or line. Transform& t; Position m_p; Dialog& d; Position GetCurrentPosition(){ return t.transform(m_p);} //other methods. } Properties I need: Each algorithms has one dialog and each dialog can have many algorithms associated with it. When the user selects an algorithm a dialog associated with that algorithm is displayed. If the user selects a different algorithm then re-selects back the state is restored in the dialog. Basically I want a good design pattern to maintain the state of the dialog given that many algorithms use it and they can be switched back and forth. Does anyone have any suggestions? Here is a use case: Dialog1 has a single edit box to control the radius. Algorithm1 generates points on a unit circle. Algorithm2 is the same as Algorithm1. The user has selected Algorithm1 and entered 2 into the edit box. This will generate points on a circle of radius 2. The user then selects Algorithm2 and enters 10 into the edit box of Dialog1. This will generate points on a circle of radius 10. Finally Algorithm1 is selected again. The edit box of Dialog1 should show 2 and points on a circle of radius 2 should be generated.

    Read the article

  • Chapter 5: From 2005 to 2010: Business Logic and Data

    After reading this chapter, you will be able to Use the Entity Framework (EF) to build a data access layer using an existing database or with the Model-First approach .Generate entity types from the Entity Data Model (EDM) Designer using the ADO.NET Entity Framework POCO templates. Get data from Web services Learn about data caching using the Microsoft Windows Server AppFabric (formerly known by the codename “Velocity”)

    Read the article

  • SEO Article Writing Tips

    Article writing can generate thousands of target web visitors for your website. Much of the traffic comes from the search engines. So whether you know it or not, you are writing articles for SEO.

    Read the article

  • How to find the longitude and latitude of a location

    - by simonsabin
    Just found this really simple but very useful site to give you the latitude and longitude of a location http://www.getlatlon.com/ The great thing is that you can select from a map and it also gives you the WKT you can use to generate you geography in SQL Server. This is the location for SQLBits VI...(read more)

    Read the article

  • Apps Script Office Hours - December 6, 2012

    Apps Script Office Hours - December 6, 2012 In this episode Eric ... - Talks about a recent blog post covering the UK Cabinet's use of Apps Script to generate Google Analytics reports. - Mentions the recent episode on triggers and the upcoming episodes covering Twillio integration and Charts Dashboards. - Answers various questions about using ScriptDb, including the storing of functions and linked objects. You can see the list of upcoming episodes here: developers.google.com From: GoogleDevelopers Views: 19 3 ratings Time: 17:23 More in Science & Technology

    Read the article

  • SEO and Product Life Cycle

    Search Engine Optimization or SEO is one of the most important online marketing activities in order to popularize a product on the Internet and generate sales. However if you analyse a lot of success stories you'll realize that it is the right time in the PLC or product life cycle when you need to capitalize on.

    Read the article

  • Search Engine Optimization Basics For Your Home Business Website

    If you are really serious about achieving success with your home business then you need to learn some search engine optimization basics. While the more technical aspects of this can be very intimidating, the basics can be very simple to understand and could help you to get better ranking, and generate more traffic to your site.

    Read the article

  • HRESULT E_FAIL Exception! (5 replies)

    Hi, I am trying to generate a powerpoint presentation in C#. It works well on my local machine which is running XP. When I run the application on Windows Server 2003 (our Server) the presentation gives HRESULT E FAIL when I call the following code chart (Microsoft.Office.Interop.Graph.Chart)slide.Shapes.AddOLEObject (GetLeft(i), GetTop(i), GetWidth(i), GetHeight(i), &quot;MSGraph.Chart&quot;, &quot;&quot;, Microsoft....

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >