Tag Info

New answers tagged

1

You can do some cool things if you allow the tiles to overlap a little and then interpolate bits that overlap. For the parts that overlap you need to calculate each tile's contribution (weight) to the overall height which I'll refer to as H(x,y). Then when you sample H(x,y) you find each tile that overlaps that point and sum the weighted local heights of ...


3

You might consider something like Wang Tiles. The idea is that you have a predetermined set of edges for your tiles. You can randomly generate tiles, still, so long as the edges match. For example, you might have 4 possible sides: A: Low terrain B: Mid terrain C: High terrain D: Water You can generate the first tile by randomly choosing the 4 sides. ...


4

You can Destroy the component. Be careful about which object you destroy, though. If you pass a GameObject to Destroy, you will destroy the entire thing. To destroy the component, you must pass a reference to that component specifically. //example: destroys the MeshRenderer attached to this GameObject var sphereMesh = GetComponent(MeshRenderer); ...


2

EDIT (added short steps): get triangle normal vector v1 (normalized) get reference surface normal vector v2 (normalized) get angle between normals : angle = acos(v1•v2) (where • = 'dot' product ) get slope = Tan(angle) if you need a surface normal here come the simple algoritm : A surface normal for a triangle can be calculated by taking the vector ...


3

I had a similar problem while trying to render a skybox. Mine was only a problem with .x files, but you might find some luck with this. It seems that the alpha is set to 0 on the rendering. My code inside the BasicEffect loop looked like this from XNA: currentEffect.LightingEnabled = false; currentEffect.PreferPerPixelLighting = false; currentEffect.World = ...


2

Since it looks like your model is loaded correctly by the pipeline, this is the most barebones solution that should work to draw it(I've just tested it). It is built with VS2015 and the most recent MonoGame DirectX template using the standard blender cube. public class Game1 : Game { GraphicsDeviceManager graphics; private Model model; ...


0

If the content load failed you should have got an error. But it's easy to check if something was loaded. Set a breakpoint and open up _model, you should have at least one ModelMesh within it, and it should contain at least one MeshPart. Have you checked if there's any effects to iterate in your rendering loop? Otherwise you might need to add a BasicEffect ...


1

As stated in the comments, drawing points is as simple as drawing GL_POINTS instead of GL_TRIANGLES, you'll need one vertex instead of three of course. Now to your non-structured input: Of course it is structured. It may not be in the format OpenGL expects, but it definitely has some sort of structure, some format you're able to parse. In case of a ...


1

The simplest solution to this would be simply buffering the vertices into a VBO like you normally do, then rendering them as GL_POINTS instead of GL_TRIANGLES or GL_TRIANGLE_STRIP. This will give you a cloud of dots, that you can rotate the usual way with your vertex shader. If you want nicely sized circles, you should use a geometry shader to create a ...



Top 50 recent answers are included