3D rendering

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
spynaz
Party member
Posts: 152
Joined: Thu Feb 28, 2013 5:49 am

3D rendering

Post by spynaz »

Hi,

I've been trying to figure out how to draw a 3D object on a 2D screen and I just can't get it. I looked over some LOVE examples but I still can't figure out anything. How do I draw a 3D object using LOVE? Can someone please explain?
User avatar
iPoisonxL
Party member
Posts: 227
Joined: Wed Feb 06, 2013 3:53 am
Location: Australia
Contact:

Re: 3D rendering

Post by iPoisonxL »

It's not simple. It is, Love2D. Requires lots of maths and stuff. Just thought I'd let you know. If you're really experienced in that kind of stuff, then I'm sorry, I'm no help.

Code: Select all

      L
    L Ö
    Ö V
L Ö V E
Ö B E
V E
E Y
Website
User avatar
spynaz
Party member
Posts: 152
Joined: Thu Feb 28, 2013 5:49 am

Re: 3D rendering

Post by spynaz »

iPoisonxL wrote:It's not simple. It is, Love2D. Requires lots of maths and stuff. Just thought I'd let you know. If you're really experienced in that kind of stuff, then I'm sorry, I'm no help.
I know it's not simple, but I still want to do it.
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 2:04 am, edited 1 time in total.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: 3D rendering

Post by jjmafiae »

you probably wanna use unity3d or sauce engine instead....
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: 3D rendering

Post by micha »

spynaz wrote:How do I draw a 3D object using LOVE? Can someone please explain?
The difficult part is the perpective projection. That is the transformation that transforms a 3d-point coordinates (x,y,z) to a 2d coordiante (on screen).
If, for a start, you assume the viewer is in the origin (0,0,0) and your screen is in the x-y-plane at z=1 then the transform is:

Code: Select all

function transform (wx,wy,wz)
  return wx/wz, wy/wz
end
Once you have the coordinates of points, you can use these to draw triangles or lines.
User avatar
spynaz
Party member
Posts: 152
Joined: Thu Feb 28, 2013 5:49 am

Re: 3D rendering

Post by spynaz »

micha wrote:
spynaz wrote:How do I draw a 3D object using LOVE? Can someone please explain?
The difficult part is the perpective projection. That is the transformation that transforms a 3d-point coordinates (x,y,z) to a 2d coordiante (on screen).
If, for a start, you assume the viewer is in the origin (0,0,0) and your screen is in the x-y-plane at z=1 then the transform is:

Code: Select all

function transform (wx,wy,wz)
  return wx/wz, wy/wz
end
Once you have the coordinates of points, you can use these to draw triangles or lines.
So that's the transform? Ok, but what about quaternions and stuff? I want to be able to rotate and move around too.
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: 3D rendering

Post by micha »

My advice is to start with the simple approach and a fixed camera position. If that works, go on and implement rotation and movement. Unfortunately, I cannot help you any further, as I haven't tried it on my own. But I am pretty sure, you will find some tutorial with google.
User avatar
spynaz
Party member
Posts: 152
Joined: Thu Feb 28, 2013 5:49 am

Re: 3D rendering

Post by spynaz »

micha wrote:My advice is to start with the simple approach and a fixed camera position. If that works, go on and implement rotation and movement. Unfortunately, I cannot help you any further, as I haven't tried it on my own. But I am pretty sure, you will find some tutorial with google.
I can't find any tutorials. Do you know any good ones?
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: 3D rendering

Post by jjmafiae »

you could also... use a... 3D engine?
Post Reply

Who is online

Users browsing this forum: No registered users and 87 guests