BHSPitMonkey / vmflib

A Valve Map Format (VMF) package for Python
BSD 2-Clause "Simplified" License
41 stars 8 forks source link

Proper U/V axis behavior #5

Open BHSPitMonkey opened 11 years ago

BHSPitMonkey commented 11 years ago

In class vmf.brush.Side, the U/V axis functionality is currently just a stub (defaulting to some values that only look correct for one particular plane orientation). These properties (uaxis and vaxis) need to be amended as follows:

  1. Replace the default strings with something likely represented with a new data type (vmf.types).
  2. When a Side object is initialized, it should compute suitable values to initialize these properties with.
  3. (Optional) Implement some way of telling a Side object to scale/reposition/transform its textures in an easy-to-use interface, without the user needing to understand linear algebra and set the uaxis/vaxis properties themselves.

[1] https://developer.valvesoftware.com/wiki/VMF_documentation#U.2FV_Axis

BHSPitMonkey commented 11 years ago

Commit 5ccc81c updates the U/V axis generation behavior for Blocks (and for any other Side that asks for its Plane's sensible_axes()) so that simple cases are covered. Unrotated sides limited to 90-degree constraints will look good. More work needs to be done to compute U/V axis values that are correct for any plane (requires someone who remembers linear algebra...)