Oysi's 3D Rendering & Physics Engine

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Oysi
Prole
Posts: 48
Joined: Fri May 02, 2014 11:18 pm
Location: Earth

Re: Oysi's 3D Rendering & Physics Engine

Post by Oysi »

Haha! Of all the things, it's the console you want to know about. xD

Very well.

veethree is indeed correct, it does loadstring. At first it sets up an environment for the console to use, and adds in all the elements from _G, such that it works like any other script. Then in the main script I put in all the stuff I want it to have extra, variables and such. And I use this separate environment because all my stuff is local, which doesn't translate over to different environments (unlike globals). On top of that, whatever global variables you define (x = 2 for example) will still work on the preceding calls as well. Then it's just a matter of opening the console, registering what you type (which you can do with love.textinput), and running whatever.

Really the only difficult part I suppose would be:

Code: Select all

local func, err = loadstring(code)
if func then
	local success, result = coroutine.resume(coroutine.create(func))
	if success then
		-- everything worked just fine, and if the thingy returned anything, it's 'result'
		-- (it can also return several values, at which point you need to pack it in a table and such)
	else
		-- runtime error, the error is 'result'
	end
else
	-- compile error, the error is 'err'
end
Or if you want to see how I made it, check this.

Take note that I never got around to rewriting it. So it's really just a prototype. But it does what I needed it to do, and very easy to use. Just call those functions through their respective love functions, and you're pretty much good to go.
Follow the potato. Achieve enlightenment.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Oysi's 3D Rendering & Physics Engine

Post by Roland_Yonaba »

A question, perhaps. Is there here a real gain in using coroutines ?
User avatar
Oysi
Prole
Posts: 48
Joined: Fri May 02, 2014 11:18 pm
Location: Earth

Re: Oysi's 3D Rendering & Physics Engine

Post by Oysi »

In this case, probably not. In this case, pcall should work the same way.

In different scenarios, coroutines are extremely helpful. For the purposes of a console, I guess the main advantage is the fact that you can yield a coroutine, and then potentially resume it later on (and repeat). Which allows you to do things like wait 3 sec, wait for an event, etc...
Follow the potato. Achieve enlightenment.
Creator
Prole
Posts: 3
Joined: Sat Oct 17, 2015 10:01 am

Re: Oysi's 3D Rendering & Physics Engine

Post by Creator »

Why do you do this?

Showing us your awesome engine without any code to learn from. Why?
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by bobbyjones »

Bro don't worry we have a new better open source replacement. Love3d \o/
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by Karai17 »

STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
Kaister93
Prole
Posts: 6
Joined: Wed Jan 31, 2018 11:34 am

Re: Oysi's 3D Rendering & Physics Engine

Post by Kaister93 »

Oysi still hasn't open-sourced his 3d engine? Sigh, I really want to take a look at a few things.
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Oysi's 3D Rendering & Physics Engine

Post by Jasoco »

Doesn't seem like it's gonna happen now. It's been 8 years. For 3D you can use Groverburger's 3D engine. But for physics, I have no idea unless Oysi decides to come back here soon. They haven't posted since 2014.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 6 guests