Tag Info

New answers tagged

0

An alternate (but potentially more difficult) method to solving OBB vs OBB collision is to transform one OBB into the space of the other, such that one of the OBBs becomes axis aligned. Basically you translate the two OBBs so that the center point of one is at (0,0) then rotate the two around (0,0) until the OBB at (0,0) becomes axis aligned. You can then ...


0

You are able to use the dual marching cubes algorithm because it just operates on an array you provided. So your code generates an area in the form of an array and the marching cubes algorithm then scans over the scene starting at some origin point you assign and finds where all the edges of your volumetric data array would be located and places bits of ...


2

If you write a 1 for a connection and 0 for lack of connection, and have 8 sides, then you can write out the configuration of an octagon as a bit string. I'll order them as east, northeast, north, northwest, west, southwest, south, southeast. If north and west are connected to neighbors and other directions are not, this would be written 0 0 1 0 1 0 0 0. ...


1

Unless you want to allow octagons to overlap (when you would, you would be in quite a lot more trouble), it is impossible for two adjacent edges (a diagonal and an orthogonal) to be both connected to another tile. This makes stuff a lot easier. Separate each of your octagons into 9 tiles like this: You need one set of tiles where the diagonals are ...


2

Just rotate the point at an angle of -θ around the center of the rectangle. relx = x-cx rely = y-cy rotx = relx*cos(-theta) - rely*sin(-theta) roty = relx*sin(-theta) + rely*cos(-theta) dx = max(abs(rotx) - width / 2, 0); dy = max(abs(roty) - height / 2, 0); return dx * dx + dy * dy; Also, remember this is still the distance squared, so you need to take ...


1

There is a realtime WYSIWYG interpolation editor: http://inloop.github.io/interpolator/


2

If you have the normal vector for the "top" face of the hex and the vector for the directional light it should be easy to determine if that hex is facing the light. Note that this will check if the hex and the light are facing each other. This will not detect of another object is in between casting a shadow over the hex. Vector3 lightDirection = ...


1

Interesting case. One way I can think of solving this would be to have an up normal on each hex tile. You would dot each hex's normal with the light source direction vector, and if the angle between them is more than 90 degrees you ignore all light calculations for the whole hex tile.


0

It is unclear as to why you are using a perpendicular. There isn't enough detail to describe the problem you are working. However, perhaps this will help. A 2D vector can be described using the values (x, y). The left hand perpendicular and the right hand perpendicular are easily calculated. The left hand perpendicular of (x, y) is (-y, x). The Right hand ...


0

In neutral position you have defined forward to be the positive Z vector (0, 0, 1). There are two vectors perpendicular to that vector (if we ignore sign), up (0, 1, 0) and left (1, 0, 0). The easiest thing would be to create all three vectors and to apply a matrix transformation to find the left, up, and forward vector in 'camera space'. Matrix transform ...


2

The vector between A and B is B - A. The magnitude of this vector is the distance between these points. If point A is traveling along this vector then it has reached point B when the magnitude is 0 and it passes B when the vector components change signs (positive to negative, or negative to positive) as compared to the original B - A vector. For example, ...


0

Here's how most people start out in it for "basic" terrain height maps ... Create my volume (voxel array). Generate a Y value for each x,z im interesting (terrain heightmap generation). Loop through a column of voxels from 0 to terrain height and set their values as "inside the volume" (on). Generate a mesh based on examination of the volume by looping ...


2

When facing this problem I found that I wanted the character to move forward at a velocity roughly proportional to how close they are to facing the target. When facing away from our target we "turn on the spot" (Red), when facing directly towards it we walk straight towards it (Green), when somewhere in between we will may walk slowly while turning (Blue ...


0

Your top code chunk is: t2 * (t1 * direction * inverse(t1)) * inverse(t2) Your bottom chunk is: t3 * direction * inverse(t3) Given that t3 = t2 * t1 It's (t2 * t1) * direction * inverse(t2 * t1) As far as my knowledge of Quaternion multiplication goes, I don't think t2 * (t1 * direction * inverse(t1)) * inverse(t2) and (t2 * t1) * direction * ...


1

He's trying to oscillate between V and V+U*0.01+R*0.1, I think. If you want to visualize, it is trying to do something like the picture below: The arrow at the top represents the path DIR will take as time proceeds and it will go back to V when the sin value becomes zero. The summation, just adds the 'perturb' effect to the DIR vector, so that it doesn't ...


4

The three component vectors right, up, and forward probably point along the axes x, y, and z relative to the camera. So by adding these vectors together you can compose any other vector. It works the same as if you built a vector by specifying its three elements individually, except that you are adding three vectors which each have one non-zero element. ...



Top 50 recent answers are included