• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang mgl64.Vec3类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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)
}
开发者ID:rexposadas,项目名称:gx,代码行数:11,代码来源:main.go


示例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)
}
开发者ID:rexposadas,项目名称:Conception-go,代码行数:21,代码来源:main.go


示例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...")
}
开发者ID:rexposadas,项目名称:gx,代码行数:31,代码来源:main.go


示例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 }
开发者ID:rexposadas,项目名称:Conception-go,代码行数:30,代码来源:text.go



注:本文中的github.com/go-gl/mathgl/mgl64.Vec3类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang gorp.DbMap类代码示例发布时间:2022-05-23
下一篇:
Golang mgl64.Vec2类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap