New answers tagged

0

x = ((X - xFocus) / (Z / depthScale)) + xFocus y = ((Y - yFocus) / (Z / depthScale)) + yFocus The point is at (X, Y, Z) The focus is the vanishing point (xFocus, yFocus) The depthScale is how much to zoom in. Usually the average of the width and height of your screen.


1

This question popped to the top because of Aeroson's answer (above/below/adjacent/falling in bits around this one) and thought I'd yoink my answer from this question in the event that it was useful to someone. What the below shader does: Downsides: not a mobile-friendly shader, due to using the stencil buffer and rendering the object twice (depending ...


2

The idea is that you extrude the object vertices along their normals. First render highlight: Render the object with disabled z write but enabled z test. Vertex shader: to each vertex add normal * highlight size before you pass it on Fragment shader: render only color, don't apply lighting Then render the object: Render with z write and z test ...


1

I would assume that most (popular) 3D model formats are basically just storing coordinate positions for all the vertices that make up the model. They probably also store texture/theming information about each polygon (that is formed by combining 3+ vertices) For games, we will almost exclusively use triangles for the final geometry (although for ...


0

They pretty much store the coordinates in a binary file What you described here is the COLLADA file format, or one of the morph formats (md1, md2, md4, etc.). COLLADA Collada supports animations by storing skeletal information about each state. It also needs to store weight information too. Because Collada is made to be a human-friendly format, it's ...


2

What you want, is a rotation around the local y-axis when either A or D is pressed. With the standard assets, this can be achieved quite easily, with the Input manager. To alter the settings, go to Edit->Project Settings->Input. You should now see the settings for the Input in your Inspector window. You want to change the Horizontal movement, so expand ...


2

Open up the FPSInputController and CharacterMotor classes. Look at how FPSInputController reads keypresses and then sends a command to the CharacterMotor. You will want to create two new commands to pass (or possibly more, I've added "crouch" and "sprint" to mine, you're looking for "rotate right" and "rotate left"). You'll have to define new inputs as ...


0

This is the best solution I found to this problem: I splitted the table model to two separate models. One contains only the table "bed" (not sure if the name is right - I mean the table top / plate). The other model has all the rest, which includes some geometry drawn over the table top (this is a kind of a billiard table actually, so it has some ...


0

I found that rendering dynamic Entity-textures in XNA such as cubes or "planes" needs alot of HLSL knowledge, how to throw in shaders and more. I scrapped my XNA project and started with Java OpenGL "LWJGL". ThinMatrix had a good tutorial series with a quick runtrough of the glsl shader system. with "dynamic" I meant rendering and changing the ...


1

When I create rocks in modelling softwares, I start from an icosaeder, fhen stretch it around, scale it a nit, then I just pick random vertices and I pull them a bit out. I suppose, the same can be made with code


3

One approach could be to start with a sphere, perhaps pick some random parameters to stretch it varying amounts so some rocks are roughly round, while others are roughly egg shaped, then use 3D perlin or simplex noise and it's fractal variants (see the fbm methods in the link) to push vertices in towards the center, or pull them out, by some multiple of the ...


0

You probably need a skybox or a skydome. A skybox is a box around the camera, and is always centered around it. Basically a model, wich isn't get transformed by the view matrix.


1

Ok, so just of the top of my head your going to want to make a new circle(2d) and apply a texture to this then write something along these lines (and attach it to the object) Pseudo code: private gameobject player private float scale; update{ face the player (using transform.lookat(player)) float distance = ...


0

XNA has a Vector3.Forward, transform that with your cameras viewmatrix and if necessary set your y component to zero and normalize. Generally if this gives you trouble you should refresh your basic understanding of linear algebra.


1

If I understand you correctly you are having problems going left and right. First off currentFrontSpeed should never be negative since it's speed not velocity. Speed is a scalar and as such should not capture any direction and will always be positive. To move in different directions you should modify the angle instead where for example right is -90 from ...


1

A possible way to solve this problem is to draw your shapes on the table texture, and then apply that modified texture to the table geometry. This would allow you to keep the shapes at the exact same level as the table, and removes the need for extra geometry to handle them.


0

Both options are basically the same. In the end you do have a bunch of vertices that you multiply by mModel * mView * mProjection. If you move the camera within the world, that transformations go into mView. If you move the world around - into mModel. mModel is actually constructed of many matrices guiding how objects and sub-objects are positioned within ...


1

Picking is not generally performed by the GPU so the use of instancing shouldn't matter. Your CPU-side code presumably knew where the cubes where in order to put their transforms into the instance buffer. Hence it can do a ray-AABB test by transforming the picking ray into the space of the cube in the cube's local space. Happily, the local space for the ...


1

Collada (.dae) files seem to have support, according to 5-51 in the 1.4 specification: The <instance_geometry> element instantiates an object described by a <geometry> element. Collada is supported by most platforms.


4

Actually every face of your mesh has UV coordinates through which UV mapping works. Let take an example of cube. Cube has 6 faces and every face has 4 coordinates. That means a Cube must have 24 coordinates for UV mapping. Now second part is to map coordinates with texture. Let's take an example of a square texture image having 6 different color boxes ( ...


2

You seem to just show the foliage at pre-determined distance. Why don't you lerp foliage opacity between transparent and opaque across some distance range? Could be the simplest most noticeable improvement.


2

You could try spreading the cubes out so there's space between them. Make a giant 3D grid of the cubes that the player can rotate around, with further ones being smaller to give depth. Since they're all spread out and rotatable, you can see any two cubes at a time and still click the interior ones. Differentiating between unit classes seems like a different ...



Top 50 recent answers are included