本文整理汇总了Golang中github.com/go-gl/mathgl/mgl64.Vec3类的典型用法代码示例。如果您正苦于以下问题:Golang Vec3类的具体用法?Golang Vec3怎么用?Golang Vec3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vec3类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: drawBox
func drawBox() {
c := mgl64.Vec3{1, 1, 1}
if boxUpdated {
c = mgl64.Vec3{42.0 / 255, 154.0 / 255, 254.0 / 255}
}
drawInnerRoundedBox(mgl64.Vec2{50, 100},
mgl64.Vec2{106, 18},
c.Mul(201.0/255),
c)
}
示例2: drawBox
func drawBox() {
/*gl.Translated(50, 100, 0)
gl.Color3d(201.0/255, 201.0/255, 201.0/255)
gl.Recti(0, 0, 106, 18)
if !boxUpdated {
gl.Color3d(1, 1, 1)
} else {
gl.Color3d(0, 1, 0)
}
gl.Recti(0+1, 0+1, 106-1, 18-1)*/
c := mgl64.Vec3{1, 1, 1}
if boxUpdated {
c = mgl64.Vec3{42.0 / 255, 154.0 / 255, 254.0 / 255}
}
drawInnerRoundedBox(mgl64.Vec2{50, 100},
mgl64.Vec2{106, 18},
c.Mul(201.0/255),
c)
}
示例3: Render
func (w *ButtonWidget) Render() {
// HACK: Brute-force check the mouse pointer if it contains this widget
isOriginHit := false
for _, hit := range mousePointer.OriginMapping {
if w == hit {
isOriginHit = true
break
}
}
isHit := len(w.HoverPointers()) > 0
// HACK: Assumes mousePointer rather than considering all connected pointing pointers
if isOriginHit && mousePointer.State.IsActive() && isHit {
//DrawGBox(w.pos, w.size)
//drawInnerRoundedBox(w.pos, w.size, highlightColor, grayColor)
c := mgl64.Vec3{42.0 / 255, 154.0 / 255, 254.0 / 255}
drawInnerRoundedBox(w.pos, w.size, c.Mul(201.0/255), c)
gl.Color3d(1, 1, 1)
//} else if (isHit && !mousePointer.State.IsActive()) || isOriginHit {
// //DrawYBox(w.pos, w.size)
// drawInnerRoundedBox(w.pos, w.size, highlightColor, nearlyWhiteColor)
} else {
//DrawNBox(w.pos, w.size)
//drawInnerRoundedBox(w.pos, w.size, mgl64.Vec3{0.3, 0.3, 0.3}, nearlyWhiteColor)
c := mgl64.Vec3{1, 1, 1}
drawInnerRoundedBox(w.pos, w.size, c.Mul(201.0/255), c)
gl.Color3d(0, 0, 0)
}
NewOpenGlStream(w.pos.Add(mgl64.Vec2{8, 3})).PrintText("Software Update...")
}
示例4: IsBold
_ "image/png"
"log"
"os"
"path/filepath"
"strings"
"github.com/go-gl/gl/v2.1/gl"
"github.com/go-gl/mathgl/mgl64"
"github.com/shurcooL/Conception-go/caret"
)
var oFontBase, oFontBackground uint32
var lodBias float64 = -66.67
var selectedTextColor = mgl64.Vec3{195 / 255.0, 212 / 255.0, 242 / 255.0}
var selectedTextDarkColor = selectedTextColor.Mul(0.75)
// FontOptions specifies the properties of the font.
type FontOptions uint8
const (
Regular FontOptions = iota
Bold
Italic
BoldItalic
)
// IsBold returns true if the font has the bold property set.
func (fo FontOptions) IsBold() bool { return fo == Bold || fo == BoldItalic }