Documentation ¶
Index ¶
- Constants
- type Coordinate
- func (c *Coordinate) After(p *gl.Painter3D)
- func (c *Coordinate) BeforeDraw(p context.Painter, pos fyne.Position, frame fyne.Size)
- func (c *Coordinate) DragEnd()
- func (c *Coordinate) Dragged(event *fyne.DragEvent)
- func (c *Coordinate) Init(p *gl.Painter3D)
- func (c *Coordinate) InitOnce(p *gl.Painter3D)
- func (c *Coordinate) NeedShader() bool
- func (c *Coordinate) Scrolled(event *fyne.ScrollEvent)
- func (c *Coordinate) UpdateFrameSize(frameSize fyne.Size)
- type DirectionLight
- type Fog
- func (f *Fog) After(p *gl.Painter3D)
- func (f *Fog) Disable()
- func (f *Fog) Draw(p *gl.Painter3D, pos fyne.Position, Frame fyne.Size)
- func (f *Fog) Enable()
- func (f *Fog) Init(p *gl.Painter3D)
- func (f *Fog) InitOnce(p *gl.Painter3D)
- func (f *Fog) NeedShader() bool
- func (f *Fog) SetModeExp()
- func (f *Fog) SetModeLinear()
- type Light
- type Line
- type Lines
- func (l *Lines) After(p *gl.Painter3D)
- func (l *Lines) AppendLine(v *Line)
- func (l *Lines) Draw(p *gl.Painter3D, pos fyne.Position, Frame fyne.Size)
- func (l *Lines) Init(p *gl.Painter3D)
- func (l *Lines) InitOnce(p *gl.Painter3D)
- func (l *Lines) NeedShader() bool
- func (l *Lines) SetDrawLoop()
- func (l *Lines) SetDrawStrIp()
- func (l *Lines) SetLineWidth(w float32) *Lines
- type Material
- type ModelConfig
- type Point
- type PointLight
- type Points
- func (p2 *Points) After(p *gl.Painter3D)
- func (p2 *Points) AppendPoint(v *Point)
- func (p2 *Points) Draw(p *gl.Painter3D, pos fyne.Position, Frame fyne.Size)
- func (p2 *Points) Init(p *gl.Painter3D)
- func (p2 *Points) InitOnce(p *gl.Painter3D)
- func (p2 *Points) NeedShader() bool
- func (p2 *Points) SetPointWidth(w float32) *Points
- type ProjectConfig
- type SpotLight
- type Texture
- func (tex *Texture) After(p *gl.Painter3D)
- func (tex *Texture) AppendImage(p image.Image)
- func (tex *Texture) AppendImageWithCustomAttr(attr string, p image.Image)
- func (tex *Texture) AppendPath(p string)
- func (tex *Texture) AppendPathWithCustomAttr(attr string, p string)
- func (tex *Texture) Init(p *gl.Painter3D)
- func (tex *Texture) InitOnce(p *gl.Painter3D)
- func (tex *Texture) NeedShader() bool
- func (tex *Texture) SetDefaultLevelData(level int32, data []uint32)
- func (tex *Texture) SetLevelData(index int, level int32, data []uint32)
- type VertexFloat32Array
- func (v *VertexFloat32Array) AddOffset(points []float32, pos fyne.Position, size fyne.Size) (res []float32)
- func (v *VertexFloat32Array) After(p *gl.Painter3D)
- func (v *VertexFloat32Array) Draw(p *gl.Painter3D, pos fyne.Position, frame fyne.Size)
- func (v *VertexFloat32Array) Init(p *gl.Painter3D)
- func (v *VertexFloat32Array) InitOnce(p *gl.Painter3D)
- func (v *VertexFloat32Array) NeedShader() bool
- type ViewConfig
Constants ¶
View Source
const ( ProjectName = "projection" ViewName = "view" ModelName = "model" )
View Source
const ( Forward = iota Backward Left Right )
View Source
const ( Yaw = -90.0 Pitch = 0.0 Speed = 3.0 Sensitivy = 0.01 )
View Source
const ( Near = 0.1 Far = 100 )
View Source
const ( LightConstant = "light.constant" LightLinear = "light.linear" LightQuadratic = "light.quadratic" LightCutOff = "light.cutOff" LightOuterCutOff = "light.outerCutOff" LightDirection = "light.direction" LightPosition = "light.position" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinate ¶
type Coordinate struct { *ViewConfig *ProjectConfig *ModelConfig // contains filtered or unexported fields }
func NewCoordinate ¶
func NewCoordinate() *Coordinate
func (*Coordinate) After ¶
func (c *Coordinate) After(p *gl.Painter3D)
func (*Coordinate) BeforeDraw ¶
func (c *Coordinate) BeforeDraw(p context.Painter, pos fyne.Position, frame fyne.Size)
func (*Coordinate) DragEnd ¶
func (c *Coordinate) DragEnd()
func (*Coordinate) Dragged ¶
func (c *Coordinate) Dragged(event *fyne.DragEvent)
func (*Coordinate) Init ¶
func (c *Coordinate) Init(p *gl.Painter3D)
func (*Coordinate) InitOnce ¶
func (c *Coordinate) InitOnce(p *gl.Painter3D)
func (*Coordinate) NeedShader ¶
func (c *Coordinate) NeedShader() bool
func (*Coordinate) Scrolled ¶
func (c *Coordinate) Scrolled(event *fyne.ScrollEvent)
func (*Coordinate) UpdateFrameSize ¶
func (c *Coordinate) UpdateFrameSize(frameSize fyne.Size)
type DirectionLight ¶
type DirectionLight struct {
*Light
}
func NewDirectionLight ¶
func NewDirectionLight() *DirectionLight
func (*DirectionLight) After ¶
func (m *DirectionLight) After(p *gl.Painter3D)
func (*DirectionLight) Init ¶
func (m *DirectionLight) Init(p *gl.Painter3D)
type Fog ¶
type Fog struct { Start float32 End float32 Colorf mgl32.Vec4 Density float32 // contains filtered or unexported fields }
func (*Fog) NeedShader ¶
func (*Fog) SetModeExp ¶
func (f *Fog) SetModeExp()
func (*Fog) SetModeLinear ¶
func (f *Fog) SetModeLinear()
type Light ¶
type Lines ¶
type Lines struct {
// contains filtered or unexported fields
}
func (*Lines) AppendLine ¶
func (*Lines) NeedShader ¶
func (*Lines) SetDrawLoop ¶
func (l *Lines) SetDrawLoop()
func (*Lines) SetDrawStrIp ¶
func (l *Lines) SetDrawStrIp()
func (*Lines) SetLineWidth ¶
type Material ¶
type Material struct { Ambient mgl32.Vec3 Diffuse mgl32.Vec3 Specular mgl32.Vec3 Shininess float32 Name string AmbientStrength float32 DiffuseStrength float32 SpecularStrength float32 }
func NewMaterial ¶
func NewMaterial() *Material
func (*Material) NeedShader ¶
type ModelConfig ¶
func NewModelConfig ¶
func NewModelConfig() *ModelConfig
func (*ModelConfig) GetModel ¶
func (m *ModelConfig) GetModel() mgl32.Mat4
func (*ModelConfig) Scale ¶
func (m *ModelConfig) Scale(x, y, z float32)
func (*ModelConfig) TranslateVec3 ¶
func (m *ModelConfig) TranslateVec3(vec mgl32.Vec3)
func (*ModelConfig) TranslateXYZ ¶
func (m *ModelConfig) TranslateXYZ(x, y, z float32)
type PointLight ¶
type PointLight struct {
*Light
}
func NewPointLight ¶
func NewPointLight() *PointLight
func (*PointLight) After ¶
func (m *PointLight) After(p *gl.Painter3D)
func (*PointLight) Init ¶
func (m *PointLight) Init(p *gl.Painter3D)
type Points ¶
type Points struct {
// contains filtered or unexported fields
}
func (*Points) AppendPoint ¶
func (*Points) NeedShader ¶
func (*Points) SetPointWidth ¶
type ProjectConfig ¶
type SpotLight ¶
func NewSpotLight ¶
func NewSpotLight() *SpotLight
type Texture ¶
type Texture struct { MixParams float32 LevelDataSize int32 // contains filtered or unexported fields }
func NewTexture ¶
func NewTexture() *Texture
func (*Texture) AppendImage ¶
func (*Texture) AppendImageWithCustomAttr ¶
func (*Texture) AppendPath ¶
func (*Texture) AppendPathWithCustomAttr ¶
func (*Texture) NeedShader ¶
func (*Texture) SetDefaultLevelData ¶
type VertexFloat32Array ¶
type VertexFloat32Array struct { Arr []float32 Index []uint32 PositionSize []int //大小和偏移 NormalSize []int TexCoordSize []int ColorSize []int // contains filtered or unexported fields }
func NewVertexFloat32Array ¶
func NewVertexFloat32Array() *VertexFloat32Array
func (*VertexFloat32Array) AddOffset ¶
func (v *VertexFloat32Array) AddOffset(points []float32, pos fyne.Position, size fyne.Size) (res []float32)
func (*VertexFloat32Array) After ¶
func (v *VertexFloat32Array) After(p *gl.Painter3D)
func (*VertexFloat32Array) Draw ¶
func (v *VertexFloat32Array) Draw(p *gl.Painter3D, pos fyne.Position, frame fyne.Size)
func (*VertexFloat32Array) Init ¶
func (v *VertexFloat32Array) Init(p *gl.Painter3D)
func (*VertexFloat32Array) InitOnce ¶
func (v *VertexFloat32Array) InitOnce(p *gl.Painter3D)
func (*VertexFloat32Array) NeedShader ¶
func (v *VertexFloat32Array) NeedShader() bool
type ViewConfig ¶
type ViewConfig struct { Position mgl32.Vec3 Front mgl32.Vec3 Up mgl32.Vec3 Right mgl32.Vec3 WorldUp mgl32.Vec3 Yaw float64 Pitch float64 LastX float32 LastY float32 MovementSpeed float64 MouseSensitivity float64 ConstrainPitch bool }
func (*ViewConfig) GetView ¶
func (c *ViewConfig) GetView() mgl32.Mat4
func (*ViewConfig) ProcessKeyboard ¶
func (c *ViewConfig) ProcessKeyboard(direction int, deltaTime float64)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.