3D in Love 11.0
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
3D in Love 11.0
I heard Love 11.0 new 3D functions such as rendering were added in. I looked around for all the 3D related functions in the wiki, but couldn't find them. Is there a reference and perhaps tutorials on how to do 3D graphics within love?
Re: 3D in Love 11.0
Hi barnyard, welcome to the forums.
LÖVE is a 2D engine. It can be made to work with 3D because support was added for the stuff that was missing, but it isn't much easier to use for 3D than raw OpenGL is, because 3D is not really its focus.
Rendering was not added in 11.0; it was supported from the beginning. Images are internally drawn as 3D faces with the Z coordinate set to 0, and with an orthographic projection. Meshes are supported since 0.9.0 and 3D mesh support since 0.10.0. Vertex shaders are also supported from 0.9.0, and fragment shaders since earlier.
What 11.0 added is support for some stuff that is almost essential for 3D like backface culling and depth buffers. Previously that could only be done by calling OpenGL through FFI.
All that said, there is at least one 3D engine for LÖVE, check out viewtopic.php?f=5&t=86350
LÖVE is a 2D engine. It can be made to work with 3D because support was added for the stuff that was missing, but it isn't much easier to use for 3D than raw OpenGL is, because 3D is not really its focus.
Rendering was not added in 11.0; it was supported from the beginning. Images are internally drawn as 3D faces with the Z coordinate set to 0, and with an orthographic projection. Meshes are supported since 0.9.0 and 3D mesh support since 0.10.0. Vertex shaders are also supported from 0.9.0, and fragment shaders since earlier.
What 11.0 added is support for some stuff that is almost essential for 3D like backface culling and depth buffers. Previously that could only be done by calling OpenGL through FFI.
All that said, there is at least one 3D engine for LÖVE, check out viewtopic.php?f=5&t=86350
Re: 3D in Love 11.0
Is there a way that I can manipulate the images so that I can change the projection to perspective and set the Z coordinate to anything I want?
Re: 3D in Love 11.0
Sure. You have to use custom shader(s) and mesh vertex format like this:
Small demo (mouselook, controls: w,s,a,d - movement):
Code: Select all
local vs = [[extern mat4 model; extern mat4 projection; extern mat4 view;
vec4 position(mat4 transform_projection, vec4 vertex_position)
{
return projection * view * model * vertex_position;
}]]
local format = {{"VertexPosition", "float", 3}, {"VertexTexCoord", "float", 2}, {"VertexColor", "byte", 4}}
mesh = lg.newMesh(format, vertices, "triangles")
- Attachments
-
- mouselook.love
- (17.84 KiB) Downloaded 600 times
Who is online
Users browsing this forum: No registered users and 3 guests