Tag Info

New answers tagged

9

Because of the linearity (aka distributive property) of vector addition and matrix multiplication, it doesn't matter! Yay! Transform(Sum(v_i)) = Transform(v_0 + v_1 + ... + v_n) = Transform(v_0) + Transform(v_1) + ... + Transform(v_n) = Sum(Transform(v_i)) EDIT: However, transformations are not commutative, so these ...


1

The camera up-vector A property of the camera you could use to solve this problem is the up-vector. This vector indicates which direction in 3D space should correspond with the (upward) vertical axis of your screen. Usually, cameras will use the positive y-axis for this, thus: (0, 1, 0). The scalar product of two vectors The scalar product of two 3D ...


2

Let me rename the vars (for clarity): Vector3 pos3d = new Vector3 (1f, 2f, 3f); Vector2 pos2d = new Vector2 (1f, 2f); Answer It is because of the section pos3d + pos2d of the line. This part is really ambiguous while the += is not. Let me clarify why one and why the other. Analysis 1 In this line transform.position = pos3d + pos2d; the compiler ...


6

Full issue message: error CS0121: The call is ambiguous between the following methods or properties: UnityEngine.Vector2.operator +(UnityEngine.Vector2, UnityEngine.Vector2)' andUnityEngine.Vector3.operator +(UnityEngine.Vector3, UnityEngine.Vector3)' Unity provided a way to implicitly convert a Vector3 to a Vector2 and vice-versa. This causes an ...


1

Your problem is transform.up = TowardOrigin;. I didn't know you could actually set transform.up until now, since it's actually a summary of a more complex state of the object -- its rotation. Setting it tells Unity to orient your object along that axis, but doesn't tell Unity to keep transform.forward as close as possible to what it used to be. You're ...


1

You can solve this by looking at the typical procedure followed when rendering a game world. When you render a 3D object, you typically apply three transformations: 1. Model Transformation (Model coordinates to World coordinates) This tranformation is applied to the model itself, disregarding anything else in the scene. It is used to scale, rotate ...


0

If you consider all possible orientations of a bounding box, the corners are on the surface of a bounding sphere. If you fit your view to the extents of that bounding sphere, you're guaranteed that your box will always fit.


0

You could either: post increment listNum prior to outputting listNum, assign your iter to listNum prior to outputting listNum, or instead of outputting listNum, just replace it with iter. The issue at hand is that your are not incrementing listNum.



Top 50 recent answers are included