Difference between revisions of "User:Substitute541/Love3D"

(updated a little)
(Updated again)
Line 1: Line 1:
{{#set:LOVE Version=0.8.x}}
+
 
{{#set:Description=(WIP) This allows you to simulate pseudo-3D in a 2D engine. No Raycasting!}}
 
 
{{notice|This library is still incomplete, you can expect some bugs... }}
 
{{notice|This library is still incomplete, you can expect some bugs... }}
  
Line 28: Line 27:
 
*'''love3D.calculatePointPosition'''. Calculates point position by transforming the 3D coordinates to 2D
 
*'''love3D.calculatePointPosition'''. Calculates point position by transforming the 3D coordinates to 2D
  
*'''love3D.graphics.circle2D'''. Draws a 2D circle in 3D space
+
*'''love3D.graphics.quad'''. Draws a quadrilateral
 +
 
 +
*'''love3D.graphics.triangle'''. Draws a triangle
  
UNDER CONSTRUCTION
+
*'''love3D.graphics.lineSegment2D'''. Draws a 2D line segmentin 3D space
 +
 
 +
*'''love3D.graphics.draw2D'''. Draws a 2D image in 3D space
 +
 
 +
*'''love3D.func.rotateX/Y/Z'''. Rotates a point in a chosen center point
 +
 
 +
*'''love3D.func.checkDistCollision'''. Checks if two circular objects in 3D space are colliding
 +
 
 +
*'''love3D.func.getAvgZTriangle/Quad'''. Finds the average Z of a triangle/quad
 +
 
 +
*'''love3D.func.zSortTriangle/Quad'''. Sorts a triangle/quad
 +
 
 +
*'''love3D.func.zSortPoint'''. Sorts a table of points
 +
 
 +
== Possible uses ==
 +
*Spinning cube for menu screens
 +
 
 +
*A more accurate Parallax Scrolling
  
 
== Contributors ==
 
== Contributors ==
 
*[[User:Substitute541|Substitute541]]
 
*[[User:Substitute541|Substitute541]]
  
 
+
{{#set:LOVE Version=0.8.x}}
 +
{{#set:Description=[WIP] This allows you to simulate pseudo-3D in a 2D engine. No Raycasting!}}
 
[[Category:Libraries]]
 
[[Category:Libraries]]

Revision as of 07:05, 16 October 2012

O.png This library is still incomplete, you can expect some bugs...  


This library allows you to simulate pseudo-3D, although you can model some basic 3D polyhedrons with the 3D triangles. There are also other functions too.

Download

Love3D Library.zip

Current Version : 0.2.7

Instructions

  1. Unzip the .zip file
  2. If you are using this, put the Love3D.lua in your .love file
  3. On the outside of any function in main.lua add :
require "Love3D"
  1. Then on the INSIDE of love.load(), near the end of the function, add :
love.load(fl, vpX, vpY)
  1. (Note : FL means Focal Length. This value is usually 250. vp means Vanishing Point) And your done! Just call the functions and your ready to go!

Functions

  • love3D.load. Loads the library, must be called in the love.load function
  • love3D.calculatePointPosition. Calculates point position by transforming the 3D coordinates to 2D
  • love3D.graphics.quad. Draws a quadrilateral
  • love3D.graphics.triangle. Draws a triangle
  • love3D.graphics.lineSegment2D. Draws a 2D line segmentin 3D space
  • love3D.graphics.draw2D. Draws a 2D image in 3D space
  • love3D.func.rotateX/Y/Z. Rotates a point in a chosen center point
  • love3D.func.checkDistCollision. Checks if two circular objects in 3D space are colliding
  • love3D.func.getAvgZTriangle/Quad. Finds the average Z of a triangle/quad
  • love3D.func.zSortTriangle/Quad. Sorts a triangle/quad
  • love3D.func.zSortPoint. Sorts a table of points

Possible uses

  • Spinning cube for menu screens
  • A more accurate Parallax Scrolling

Contributors