Skip to content
项目

关于

面向 LÖVE 的简单易用 3D 引擎。

其他项目

这些数字如何统计

可以做什么

  • Textured 3D model rendering
  • OBJ file loading
  • Perspective and orthographic cameras
  • Custom vertex and fragment shader support

实测星标增长

24小时
+2
7天
+4
15天
+5
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文
g3d

groverburger's 3D engine (g3d) simplifies LÖVE's 3d capabilities to be as simple to use as possible.

pic1

Getting Started

  1. Download the latest release version.
  2. Add the g3d folder to your LÖVE project.
  3. Add local g3d = require "g3d" to your main.lua file.

The entire main.lua file for the Earth and Moon demo is under 30 lines:

local g3d = require "g3d"
local earth = g3d.newModel("assets/sphere.obj", "assets/earth.png", {4,0,0})
local moon = g3d.newModel("assets/sphere.obj", "assets/moon.png", {4,5,0}, nil, 0.5)
local background = g3d.newModel("assets/sphere.obj", "assets/starfield.png", nil, nil, 500)
local timer = 0

function love.update(dt)
    timer = timer + dt
    moon:setTranslation(math.cos(timer)*5 + 4, math.sin(timer)*5, 0)
    moon:setRotation(0, 0, timer - math.pi/2)
    g3d.camera.firstPersonMovement(dt)
    if love.keyboard.isDown "escape" then
        love.event.push "quit"
    end
end

function love.draw()
    earth:draw()
    moon:draw()
    background:draw()
end

function love.mousemoved(x,y, dx,dy)
    g3d.camera.firstPersonLook(dx,dy)
end

Features

  • Textured 3D model rendering
  • OBJ file loading
  • Perspective and orthographic cameras
  • Custom vertex and fragment shader support
  • Basic first-person movement and camera controls
  • Lightweight collision queries
  • Simple, commented, and organized

Documentation

The g3d wiki explains the camera, models, custom shaders, collisions, and other topics in more detail. The original forum post has more project history and discussion.

Games and demos made with g3d

Hoarder's Horrible House of Stuff by alesan99
Hoarder's Gif

Lead Haul by YouDoYouBuddy
Lead Haul Screenshot

Plan Meow by SaceMakesGame Plan Meow Screenshot

First Person Test by groverburger
First Person Test Gif

g3d voxel engine by groverburger
g3d_voxel3

探索相关项目

加载中…