Method of model projective transformations

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


Sie betrachten gerade eine ältere Version des Eintrags. Klicken Sie hier, um zur aktuellen Version zu gelangen.

  • Introduce a way to transform your mesh in a irregular way, often used for bending.
    In Transport Fever, a mod creator can do transforms to any model, it's easy once the transformations is an affine transformations. Written in vector and matrix: With [code]M = ⎡m11 m12 m13 m14⎤ ⎢m21 m22 m23 m24⎥ ⎢m31 m32 m33 m34⎥ ⎣ 0 0 0 1 ⎦ A = (x, y, z, 1)ᵀ B = (`x, `y, `z, 1)ᵀ[/code]and [code]M.A = B[/code]Where [code]`x = x * m11 + y * m12 + z * m13 + m14 `y = x * m21 + y * m22 + z * m23 + m24 `z = x * m31 + y * m32 + z * m33 + m34[/code]So the between the original coordinate (x, y, z)ᵀ and (`x, `y, `z)ᵀ, it's an linear projection. For any triangle: [code]X = ⎡x1, y1, z1, 1⎤ᵀ ⎢x2, y2, z2, 1⎥ ⎣x3, y3, z3, 1⎦[/code]With the same matrix you can get [code]Y = ⎡`x1, `y1, `z1, 1⎤ᵀ ⎢`x2, `y2, `z2, 1⎥ ⎣`x3, `y3, `z3, 1⎦[/code]So [code]M.X -> Y[/code]And [code]M [`x, `y, `z, `w]ᵀ[/code] With five non-coplanar coordinates, you will be able to get an matrix M that can transform a rectangle to any form in the space, however, you need to deal with the last element w, to make it 1 [code][`x, `y, `z, `w]ᵀ -> [`x/`w, `y/`w, `z/`w, 1]ᵀ[/code]However, this can not be done with the mod, it should be done with the compiled code of Transport Fever, and UG didn't do this step. So the only way to do such transformation is to divide your mesh diagonally.

Teilen