Tag Info

New answers tagged

0

You need to transform the world space rotation vector to model space before applying the rotation. Vectors are transformed with inverse transpose of the matrix, i.e. v'=transpose(inverse(M))*v Because models generally define model->world matrix you need to invert this to get world->model matrix. So you need to calculate v' = ...


-1

Unity3D works on top of GameObject-Component model. It's so much different than Entity Component Systems. To my experience it's worse because when you want to code some logic it's put into Script Component, instead of Systems. How different is it to OOP model? Unity3D GameObject contains data and logic - same as in OOP, those components aren't reusable ...


-1

No, from rasterization point of view both are the same. GPU processes all points independently and doesn't care about their position.


1

You cannot count with px, px are irrelevant because of different resolutions. Cast a ray onto plane at your target location perpendicular to the direction(target loc - actor loc) vector. Then calculate the distance between ray(aiming direction) intersection with that plane and your target location on the plane. Note, this is one way of doing it. If you dont ...


0

According to the book Real-Time Cinematography for Games, the fastest but least accurate way to do this is by calculating the projection of an object's bounding sphere onto the viewplane of the camera. r = f*r_w / (v . (p_w - q)) Where: f = focal length r_w = bounding sphere radius of the object v = normalized camera direction p_w = bounding center of ...


2

Yes, there are many performance implications to consider even when two objects share the same amount of geometry. Fragments that fail a Z-buffer test will not invoke fragment shaders. The amount of screen-space that the objects occupy will impact performance, as fill-rate is a big deal especially on mobile devices. If you have large triangles that are ...


4

Deep within the game engine your mesh is defined by your vertices, your indices (which define how to draw the triangles using the vertices), and its material (which consists of the shader as well as other parameters). Submeshes allow you to define separate lists of indices and materials (depending on the engine) over the same vertex data which is useful not ...


0

I mostly work on GLES where we don't have geometry shaders, so don't expect my code to work as-is. The problem is that you're creating the vertices in world space (3D), and then projecting them independently. If you want your text to be facing the camera regardless of the camera settings, then you want to create your vertices in screen space (2D), not ...


1

To render just the edges of an arbitrary polygon you could use a Solid Wireframe technique. It uses barycentric coordinates to determine which edges to draw. For example you might have a triangle whose barycentric coordinates are (for each vertex) B0: (1, 0, 0) B1: (0, 1, 0) B2: (0, 0, 1). Put it simply, when these values are interpolated the further any of ...


2

This is generic solution that will work even with FFP: Sort models from far to near (in the example this is just a matter of 2 planes) Set blending to additive. Render opaque outline; Render half-transparent insides; Render outlines with half-transparent fading gradient; Render glowing dots sprites on the corners.


0

In very crude pseudo-code : Draw the "laser lines" to an off screen buffer. in case of openGL, this could be a FrameBuffer Then draw the off screen buffer to the screen. Blur the off screen buffer you could use GLSL shaders, or even a hand coded kernel for this Blend the (now blurred off screen buffer) to the screen (using additive blending) ...


0

DirectXMath has the overloads needed for this operation: struct XMMATRIX { XMMATRIX& operator*= (float S); XMMATRIX operator* (float S) const; friend XMMATRIX XM_CALLCONV operator* (float S, FXMMATRIX M); }; Likely the problem you are having is that you do not have the proper namespace scope active to find the operator* ...


2

Three vertices are easy. Just place them in the same location as the three vertices of the clicked face. For the rest of this answer, we'll call these vertices v1, v2, and v3. To position the 4th vertex, first take the cross product of v1 → v2 and v1→ v3. (If this returns a vector pointing backward, just swap v2 and v3.) vUp = normalize(cross(v2 - v1, v3 - ...


3

Keep in mind I had this problem over 2 years ago and I have since moved onto Unity 3D. This is more of a conclusion than a solution. The main problem was that moving the bones did not move the mesh. I used Cinema 4D to model and rig the model and exported as fbx. There are many fbx export options in C4D and I tried many variants with no success. Here are ...


0

Unity does not provide an export option for additional modelling. However, it does provide the option to export an animated model (and other things) into .unitypackage format using Assets > Export package... (As far as I can tell this includes the FBX files you can find in the project folder.) In my case this was sufficient for the artist to inspect the ...


2

A possible solution is to use the Dot Product. Of course, you need two vectors and not two angles, but I guess you're using them (otherwise I wouldn't explain how you're having 3D angles). Quoting Van Verth & Bishop from the book Essential Mathematics for Games & Interactive Applications, page 30-31: A more common use of the dot product is to ...


0

for a similar requirement in a prototype (all be it on unity for desktop) but i think the logic, planning & structure should stay the same. i was able to create a parent object for each class of weapon with different animations. then i added all the different appearance of the different models as children of that parent object and simply animated the ...


0

According to the reference page for GraphicsDevice.DrawPrimitives(), it can throw one of two exceptions - ArgumentOutOfRangeException and InvalidOperationException - and only the former has anything to do with primitiveCount. When you say the error only says "primitiveCount", that's must be the exception's description, while the type is ...


1

referencing a video clip here i imagine there are a few things going on: not every bullet is being drawn with a "tracer" - just like you said in theory i think you could accomplish this effect rather simply, when firing bullets you could create every Nth bullet with a different type. you can have the visual appearance of that bullet be an illuminated ...


0

You can't make a cave in Unity's terrain system natively because it uses a 2d heightmap, where each point can only have one height. This allows for some major optimizations (and a radically different approach) compared to a system that allows for 3D height definition. But there is an easy work around that AAA games have used (including certain CryENGINE ...


0

Is it better to shade a model inside the 3D modeling software or inside Unity? Any effects brought by shaders in your modeling software have to be recreated in Unity, those won't be carried over. When you import a 3D model into Unity you import structural data (geometry, material info, texture coords and in some cases the list goes on, for example, ...


2

Check our approach. http://dsp.agh.edu.pl/en:research:rayav Developed library utilizes beamtracing to provide user with realistic audio auralization. All audio effects are computed based on the actual geometry of a given game level as well as its acoustic properties (acoustic materials, air attenuation). The sound changes dynamically along with movement of ...


10

In deferred shading all the material properties are rendered into the G-buffer, e.g. albedo, normals, roughness, metalness, etc. that are needed for BRDF evaluation. After this step shading is performed for pixels within light volumes using light and material properties as input to the BRDF. The problem with deferred shading is that more complex BRDF's (e.g. ...


0

If you're too far from the target and there is no current path to navigate Compute a new path to the target. Otherwise Apply your game logic here (attack, heal, talk, etc.)


0

Metaballs is a good way to think about solving this problem. It's usually the way that people develop implicit surfaces using particle-based fluid simulation like Smoothed Particle Hydrodynamics. There have already been a few questions asked about how to render metaballs: How to render metaballs? 2D metaball liquid effect - how to feed output of one ...


0

function OnPathComplete(newPath : Path) { if(!newPath.error) { path = newPath; currentWaypoint = 0; GetNewPath(); } }



Top 50 recent answers are included