I'm trying to create a isometric game in Love2D. I need to use meshes because I want to be able to rotate the camera view, but I could not figure out how to use a tileset to provide textures for the mesh.
The mesh class accepts a texture only, unlike the sprite batch class, which accepts quads to direct it on what part of the texture to use. Is there a way to give the mesh class this information or even slice up the tileset into individual images to be used with meshes?
Related
I'm working on a university project for which I want to texturize meshes which were generated using the new LiDAR sensor on recent Apple devices at run-time.
I've read some research papers about texturing 3D reconstructions and I want to try a 'simple' approach were mesh faces (triangles) are transformed to image-space of key-frames that were taken with the camera of the device. Then, I want to perform a pixel-lookup at the position of the triangle in the image and then add that part of the image to a texture map. When I keep track of all triangles in the mesh and determine its corresponding color in a relevant key-frame, I should be able to infer the texture / color of all triangles in the mesh.
Here is a demonstration of the aforementioned principle:
I need to do this natively in swift and therefore I will be using Metal for this. However, I have not worked with Metal before and my question is whether it is possible to "stich together" a texture from different image sources dynamically at run-time?
I'm developing an application that uses SceneKit API and I faced the problem that I basically cannot apply a texture to a sphere object and keep texture's pre-defined size. I'm able to either scale the texture up to the object's surface (default SceneKit's behavior) or repeat it. But what I want to achieve is similar to the billiard ball:
Let's say I have a a .png image of a white circle with the number "13" at the center of it. I want to put it like the one on the picture. Generally, I want it to be scaled up to a fixed size, not the whole surface.
I use material.diffuse.contents property of SCNGeometry to set the texture and I found contentsTransform property in the documentation which can probably help me sort it out but I didn't find an explanation how to use it with the sphere object.
Is it something that is possible with pure SceneKit? Any help would be very appreciated.
You need a preliminarily modelled geometry (polygonal sphere in your case) and its UV Mapped texture that's made in 3D modelling software (Autodesk Maya for instance).
Watch this short movie to find out how to get UV-mapped texture.
I'm trying to learn SceneKit for iOS and get beyond basic shapes. I'm a little confused on how textures work. In the example project, the plane is a mesh and a flat png texture is applied to it. How do you "tell" the texture how to wrap to the object? In 3D graphics you UV unwrap, but I don't know how I would do this in SceneKit.
SceneKit doesn't have capabilities to create a mesh (other than programatically creating vertex positions, normals, UVs etc). What you'd need to do is create your mesh and texture in another bit of software (I use Blender). Then export the mesh as a collada .dae file and export the textures your model uses too as .png files. Your exported model will have UV coordinates imported with it that will correctly wrap your imported textures on your model.
I'm making a game with my friend that involves randomly generating planets based on certain properties. Originally this game was all 2D, but now we've decided to enhance the purpose of planets in the game and make it 2.5D, with planets being rendered as 3D spheres in an otherwise 2D world. Now, up to this point we had a pretty good thing going with the way planets looked. We used layered textures, one for each property (water, land, atmosphere) depending on how our algorithms created the planet. This looked pretty, but the planet surfaces were largely lame and didn't vary as they were all made from the same few textures.
Now that we are going 3D, I want to create a nice planetary map which will determine the topography of the planet based on its properties to make each planet have different bodies of water, land masses, etc. I also want to draw different textures on the surface of the planet based on that map, with them blending together at the edges.
I've considered two possibilities: rendering the textures based on the map to a RenderTarget and then wrapping that RenderTarget around my sphere model, or converting the map to vertex data and writing a shader to draw the textures with the proper weight.
The problem is, I'm a novice at both RenderTargets and HLSL (as a matter of fact, I don't even know if the RenderTarget method is possible), so I feel the need for some guidance here. What would be recommended for rendering multiple textures to a sphere model based on a generated terrain map? Also, are there any suggestions for what format to create the terrain map in (it would be some sort of data structure which would represent the type of terrain at any coordinate on the planet's surface)?
I have looked at other multi-texture tutorials, but they all seem based on a pre-determined texture or set of values. I need to be able to randomly generate the terrain in-game.
I am loading a Texture2D that contains multiple sprite textures. I would like to pull the individual textures out when I load the initial Texture to store into separate Texture2D objects, but can't seem to find a method any where that would let me do this. SpriteBatch.Draw I believe should only be called from within a begin, end block right?
Thanks.
I am loading a Texture2D that contains
multiple sprite textures. I would like
to pull the individual textures out
when I load the initial Texture to
store into separate Texture2D objects.
You don't have to do this nor should you. Accessing a single texture is faster than multiple textures. Also, textures are stored in GPU texture memory. It just makes no sense to split it up.
You should instead focus on writing code that can access individual sprites within your sprite sheet. I suggest you have a look at how sprite based games work.
Here is a great tutorial video series that should help you out: tile engine videos