Tag Info

New answers tagged

2

It is typical to use a 32-bit depth-buffer: GL_DEPTH_COMPONENT32F //internal format GL_DEPTH_COMPONENT //depth only GL_FLOAT //float(32-bit depth) If you also wish to utilize the stencil buffer, it is typical to dedicate 8 of those 32-bits to the stencil: GL_DEPTH24_STENCIL8 //internal format GL_DEPTH_STENCIL //depth + stencil ...


0

By speculation - this is what it looks like to me. The arrows seem to, as others say, have an extra variable to determine their height. It looks like an X and Y velocity of the dart might be determined by the direction and power of the power bar, with a predetermined height. I'm not sure if the darts are shot at an upward angle. If not then the flight time ...


2

As nikoliazekter explained, you'd have to calculate the integral over the surface of polygon P. To solve this integral, you'd probably use a numerical approximation. I don't think it is realistic to do this in a real-time application, due to the complexity of this calculation. While solutions might exist for some specific shapes, they don't for polygons P ...


0

3D models for something that uses minimalist art is completely overkill. The arrows' effects are most likely produced by 2D art and some math. First, the arrows are given a rotation based on the angle that the player makes with the mouse, upon release of the left mouse button. Then, based upon how long the mouse button was held, the arrows are given a ...


3

I've made projectiles like this in a game and they are most likely 2D for all purposes besides selecting the correct sprite. Then a third Height variable is maintained and some simplified physics is applied. This variable might even be "time in air". So they are likely represented in 2D (x,y) and animated using a third tertiary variable


2

I assume eye and look are in global space and up is in local space. Then you can use this: tmp = (look - eye) * up up = normalize(tmp * (look - eye)) tmp, look, eye and up are 3D vectors. * means cross product. - means usual vector subtraction. normalize() is normalization function, which returns same vector but with lenght == 1. If for some reason look ...


0

The general approach for games is that models are created and edited in some 'source' format (like WaveFront OBJ, Autodesk FBX, etc.). The models are then "exported" to some format which is optimized for runtime usage, usually something specific to the game engine being used. DirectX Tool Kit supports loading Models from VBO, CMO, and SDKMESH as example ...


1

Verdict: One of the cBuffers was set to the incorrect stage. Edit: I'll leave this here because it was irrelevant, but not entirely worthless in the future. If your structs are cbuffers, they should be of type cbuffer. cbuffer cbBaseLight : register(b0) //16*2=32-bytes { float4 color; float4 intensity; }; cbuffer cbDirectionalLight : register(b1) ...


1

You could rotate every single point after you created them like this: var rotation = Quaternion.FromToRotation(Vector3.up, axis.normalized); var rotatedPoint = rotation * point; But I still think that rotating the object node is a more elegant way.


0

ochi12 you asked this question opengl my triangle is always the same color? they closed your thread, but I understand the question. You asked why the color does not change, you need to send the vertex and color to the vertex shader then from there to the fragment shader, you try to send the vertex to one shader and the color to the other, the color must ...



Top 50 recent answers are included