Documentation ¶
Overview ¶
Used this resource https://andreasrohner.at/posts/Web%20Development/JavaScript/Simple-orbital-camera-controls-for-THREE-js/
Index ¶
- Constants
- func BindFramebuffer(fType, index uint32)
- func BlendFunc(sFact, dFact uint32)
- func Clear(mask uint32)
- func ClearColor(r, g, b, a float32)
- func DepthFunc(v uint32)
- func Disable(v uint32)
- func Enable(v uint32)
- func NewCube(p VertParams) (uint32, []int32, []float32)
- func NewSphere(p VertParams) (uint32, []int32, []float32)
- func PolygonMode(v1, v2 uint32)
- type Cubemap
- type Framebuffer
- type OrbitalCamera
- type Shader
- func (s *Shader) SetBool(name string, value bool) *Shader
- func (s *Shader) SetFloat(name string, value float32) *Shader
- func (s *Shader) SetInt(name string, value int32) *Shader
- func (s *Shader) SetMat4(name string, value mgl.Mat4) *Shader
- func (s *Shader) SetVec2(name string, value mgl.Vec2) *Shader
- func (s *Shader) SetVec3(name string, value mgl.Vec3) *Shader
- func (s *Shader) Use() *Shader
- type Texture
- type VAO
- type VertParams
- type Window
Constants ¶
View Source
const ( TEXTURE0 = gl.TEXTURE0 TEXTURE1 = gl.TEXTURE1 TEXTURE2 = gl.TEXTURE2 TEXTURE3 = gl.TEXTURE3 TEXTURE4 = gl.TEXTURE4 TEXTURE5 = gl.TEXTURE5 TEXTURE6 = gl.TEXTURE6 TEXTURE7 = gl.TEXTURE7 )
View Source
const ( POINTS = gl.POINTS LINES = gl.LINES LINE_LOOP = gl.LINE_LOOP LINE_STRIP = gl.LINE_STRIP TRIANGLES = gl.TRIANGLES TRIANGLE_STRIP = gl.TRIANGLE_STRIP TRIANGLE_FAN = gl.TRIANGLE_FAN )
View Source
const ( DEPTH_BUFFER_BIT = gl.DEPTH_BUFFER_BIT STENCIL_BUFFER_BIT = gl.STENCIL_BUFFER_BIT COLOR_BUFFER_BIT = gl.COLOR_BUFFER_BIT )
View Source
const ( DEPTH_TEST = gl.DEPTH_TEST LEQUAL = gl.LEQUAL LESS = gl.LESS BLEND = gl.BLEND ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA ONE_MINUS_CONSTANT_COLOR = gl.ONE_MINUS_CONSTANT_COLOR ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR SRC_ALPHA = gl.SRC_ALPHA )
View Source
const ( FRONT_AND_BACK = gl.FRONT_AND_BACK LINE = gl.LINE )
View Source
const (
FRAMEBUFFER = gl.FRAMEBUFFER
)
Variables ¶
This section is empty.
Functions ¶
func BindFramebuffer ¶
func BindFramebuffer(fType, index uint32)
func ClearColor ¶
func ClearColor(r, g, b, a float32)
func PolygonMode ¶
func PolygonMode(v1, v2 uint32)
Types ¶
type Cubemap ¶
type Framebuffer ¶
type Framebuffer struct {
// contains filtered or unexported fields
}
I don't understand framebuffers and usage as much as I would like to So ideally I want to revisit this for when usage needs more customization.
func NewFramebuffer ¶
func NewFramebuffer(width, height int32) *Framebuffer
func (*Framebuffer) Bind ¶
func (f *Framebuffer) Bind()
func (*Framebuffer) BindTexture ¶
func (f *Framebuffer) BindTexture(v uint32)
type OrbitalCamera ¶
type OrbitalCamera struct { Position mgl.Vec3 ScaleFactor float32 Sensativity float32 // contains filtered or unexported fields }
func NewOrbitalCamera ¶
func NewOrbitalCamera(w *Window, radius float32, center mgl.Vec3) *OrbitalCamera
func (*OrbitalCamera) LookAt ¶
func (c *OrbitalCamera) LookAt() mgl.Mat4
type Texture ¶
type Texture struct { Width int32 Height int32 InternalFormat int32 ImageFormat uint32 WrapS int32 WrapT int32 FilterMin int32 FilterMax int32 // contains filtered or unexported fields }
func NewTexture ¶
func NewTexture() *Texture
func TextureFromFile ¶
type VertParams ¶
type VertParams common.VertParams
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func (*Window) PollEvents ¶
func (w *Window) PollEvents()
func (*Window) SwapBuffers ¶
func (w *Window) SwapBuffers()
Click to show internal directories.
Click to hide internal directories.