New answers tagged

3

First of all if you are interested in generating meshes I recommend to you this series of articles in gamasutra about procedural meshes Modelling by numbers So returning to the main question, generate planes procedurally allows you to define the distribution of the vertex, for example I use this kind of methods to generate low poly terrains So if you ...


0

There's a trick you can use to numerically remove (or rather reduce as much as you want) any scaling from the upper 3x3 sub-matrix, assuming it's not singular. Let's call that 3x3 sub-matrix M. You can take the transpose of the inverse of M, and average it with M. That will be the new M for the next loop. while (...) { N = (transpose(inv(M)) + ...


0

Main ways to speed up frustum culling (and collision in general): simplified bounding: you have AABBs (check) fast collision functions: looks like you are doing this (in progress) spatial partitioning objects in the world: ??? Spatial partitioning gives the most speed up. Are you doing anything? Depending on game type, there are a ton of easy ways to get ...


1

In native code, where you're using a while loop you've set up in main, this is exactly how all checks are done. There is in fact no other way to do it, under these circumstances, since the native while loop runs as fast as possible and only acts when some condition is met (like yours). In non-native framework code or for certain platforms (like JS), there ...


1

This is unlikely to be an issue. A single branch 60 times a second is not even a blip on the radar for a profiler. However if you have arbitrary events that trigger at certain points (not just on turn of day) then you can make newDay a fixed recurring daily event. Then the update loop will be: void Update(float _delta) { gameTimeInSeconds += _delta * ...


1

Thanks for your patience, the particle solution below took a bit more fiddling to get working than I'd counted on. ;) Note that in all of these methods (and the one proposed by lvictorino) the texture is shared - what you're asking for doesn't require duplicating the texture in memory. What can pile up are draw calls, so let's look at how we can minimize ...


0

Your quads may be game objects and have a MeshRenderer. MeshRenderer components give you access to the renderer Material. And the Material gives you access to the texture via SetTexture. So once you have Instantiated your new object you can set your Texture doing: MeshRenderer object_renderer = my_new_game_object.GetComponent<MeshRenderer>(); ...


2

Assuming your matrix multiplication follows the convention... M * v = (T * R * S) * v (where M is your composed matrix, T is a Translation matrix, R rotation, S scale, and v is a vector you want to transform using the matrix) ...then you can normalize the first three columns of the matrix to get just the T * R part. If you use the opposite matrix ...



Top 50 recent answers are included