Documentation ¶
Index ¶
- func CalculateCenter(v []Vertex) [2]float32
- func CreateVertexBuffer(device *wgpu.Device, vertices []Vertex, width float32, height float32) *wgpu.Buffer
- func ScreenToNDC(x, y, screenWidth, screenHeight float32) [3]float32
- type Surface
- type Transform
- func (t *Transform) CreateBuffer()
- func (t *Transform) Destroy()
- func (t *Transform) Move(screenX, screenY float32)
- func (t *Transform) Resize(screenWidth, screenHeight float32)
- func (t *Transform) Rotate(a float32) matrix.Matrix
- func (t *Transform) Scale(sx, sy float32) matrix.Matrix
- func (t *Transform) Update()
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateCenter ¶
func CreateVertexBuffer ¶
func ScreenToNDC ¶
ScreenToNDC transforms screen space coordinates to NDC. screenWidth and screenHeight are the dimensions of the screen.
Types ¶
type Transform ¶
type Transform struct { *wgpu.Device *wgpu.SwapChainDescriptor *wgpu.Buffer matrix.Matrix // contains filtered or unexported fields }
func NewTransform ¶
func (*Transform) CreateBuffer ¶
func (t *Transform) CreateBuffer()
type Vertex ¶
Vertex represents a single vertex in the shape.
func ConvertVerticesToNDC ¶
convertVerticesToNDC converts an array of vertices from screen space to NDC.
Click to show internal directories.
Click to hide internal directories.