A rendering program in lua
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
A rendering program in lua
So I've been thinking about a problem which I won't discuss right now because it's of no relevance, but how I have been trying to solve it.
So here's what happened... I made a basic rendering software. You have a dot on a screen, and you can use code to make it move around. So far I made a basic physics engine with bouncy balls.
Anyway, I just thought I'd ask for an opinion on it. It's actually the first time I've done anything like it and I'd like feedback!
http://notepad.cc/robrender1
Plug this code into this:
http://www.lua.org/cgi-bin/demo
Right now the physics are... Buggy, to say the least. But I'm working on improving them.
So, give me your opinion! How's my rendering code skills?
So here's what happened... I made a basic rendering software. You have a dot on a screen, and you can use code to make it move around. So far I made a basic physics engine with bouncy balls.
Anyway, I just thought I'd ask for an opinion on it. It's actually the first time I've done anything like it and I'd like feedback!
http://notepad.cc/robrender1
Plug this code into this:
http://www.lua.org/cgi-bin/demo
Right now the physics are... Buggy, to say the least. But I'm working on improving them.
So, give me your opinion! How's my rendering code skills?
Convincing people that 0.9999... = 1 since 2012
-
- Posts: 523
- Joined: Mon Jun 03, 2013 4:54 pm
Re: A rendering program in lua
Heh, cool! Though using a grid to display continuous data isn't exactly idealrobly18 wrote:So I've been thinking about a problem which I won't discuss right now because it's of no relevance, but how I have been trying to solve it.
So here's what happened... I made a basic rendering software. You have a dot on a screen, and you can use code to make it move around. So far I made a basic physics engine with bouncy balls.
Anyway, I just thought I'd ask for an opinion on it. It's actually the first time I've done anything like it and I'd like feedback!
http://notepad.cc/robrender1
Plug this code into this:
http://www.lua.org/cgi-bin/demo
Right now the physics are... Buggy, to say the least. But I'm working on improving them.
So, give me your opinion! How's my rendering code skills?

$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
Always check your units or you will have no money!
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
Re: A rendering program in lua
Well, how do you suggest I make a way to display the information reasonably in the form of ASCII?A Random Player wrote:Heh, cool! Though using a grid to display continuous data isn't exactly idealrobly18 wrote:So I've been thinking about a problem which I won't discuss right now because it's of no relevance, but how I have been trying to solve it.
So here's what happened... I made a basic rendering software. You have a dot on a screen, and you can use code to make it move around. So far I made a basic physics engine with bouncy balls.
Anyway, I just thought I'd ask for an opinion on it. It's actually the first time I've done anything like it and I'd like feedback!
http://notepad.cc/robrender1
Plug this code into this:
http://www.lua.org/cgi-bin/demo
Right now the physics are... Buggy, to say the least. But I'm working on improving them.
So, give me your opinion! How's my rendering code skills?
Convincing people that 0.9999... = 1 since 2012
-
- Posts: 523
- Joined: Mon Jun 03, 2013 4:54 pm
Re: A rendering program in lua
Print the positions?robly18 wrote:Well, how do you suggest I make a way to display the information reasonably in the form of ASCII?A Random Player wrote:Heh, cool! Though using a grid to display continuous data isn't exactly idealrobly18 wrote:So I've been thinking about a problem which I won't discuss right now because it's of no relevance, but how I have been trying to solve it.
So here's what happened... I made a basic rendering software. You have a dot on a screen, and you can use code to make it move around. So far I made a basic physics engine with bouncy balls.
Anyway, I just thought I'd ask for an opinion on it. It's actually the first time I've done anything like it and I'd like feedback!
http://notepad.cc/robrender1
Plug this code into this:
http://www.lua.org/cgi-bin/demo
Right now the physics are... Buggy, to say the least. But I'm working on improving them.
So, give me your opinion! How's my rendering code skills?

6
9
11
12
12
11
9
6
2
Other than that, not sure. You could try to use a larger box, or try a "graph paper" approach, plotting position vs time:
Code: Select all
##
# #
# #
# #
Code: Select all
#
#
#
#
#
#
#
#
#
#
#
#
But these methods can only show motion in one dimension. To keep two dimensions, I would try putting a border around the boxes, or maybe other "landmarks", so our eyes can easily move between the pictures and see the locations of the ball:
Code: Select all
+-------+
| |
| \ / |
| |
| x |
| |
| / \ |
|O |
+-------+
+-------+
| |
| \ / |
| |
| x |
| O |
| / \ |
| |
+-------+
+-------+
| |
| \ / |
| |
| Ox |
| |
| / \ |
| |
+-------+
+-------+
| |
| \ / |
| |
| O |
| |
| / \ |
| |
+-------+
+-------+
| |
| \ / |
| |
| x |
| O |
| / \ |
| |
+-------+
(After reviewing it in notepad, I have to say that it looks somewhat better. I guess the tiny output box is slightly to blame.)
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
Always check your units or you will have no money!
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
Re: A rendering program in lua
Hm. I like the landmarks idea. However, the position over time is something I'd rather not do. The problem I have in mind requires me to have a good view of the X and Y position over time, so...
But yeah, I might add those landmarks.
But yeah, I might add those landmarks.
Convincing people that 0.9999... = 1 since 2012
- testtubegames
- Site Admin
- Posts: 1164
- Joined: Mon Nov 19, 2012 7:54 pm
Re: A rendering program in lua
Interesting question. I agree, it's kinda tough to picture how the objects are moving when it's separated into a bunch of frames. Landmarks could work, but for cleanliness, I might suggest putting a ghost trace on the ball.
So the ball is represented by some significant character. Then behind it is a trail of ghosts... some less significant characters (1, 2, or maybe even 3 steps-worth of ghosts).
My simplistic attempt at drawing it, using a capital 'O' trailed by asterisks:
------------------
| |
| O |
| * |
| * |
| * |
------------------
------------------
| |
| * O |
| * |
| * |
| |
------------------
------------------
| |
| * * |
| * O|
| |
| |
------------------
Edit: Spaces are weirdly (not) shown here, see Robly's response for a better looking version
So the ball is represented by some significant character. Then behind it is a trail of ghosts... some less significant characters (1, 2, or maybe even 3 steps-worth of ghosts).
My simplistic attempt at drawing it, using a capital 'O' trailed by asterisks:
------------------
| |
| O |
| * |
| * |
| * |
------------------
------------------
| |
| * O |
| * |
| * |
| |
------------------
------------------
| |
| * * |
| * O|
| |
| |
------------------
Edit: Spaces are weirdly (not) shown here, see Robly's response for a better looking version
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
Re: A rendering program in lua
That's a good idea, but I feel it would require a lot of variables. However, I'll try it when i think of a way to do it. Also, fixed your spaces.testtubegames wrote:Interesting question. I agree, it's kinda tough to picture how the objects are moving when it's separated into a bunch of frames. Landmarks could work, but for cleanliness, I might suggest putting a ghost trace on the ball.
So the ball is represented by some significant character. Then behind it is a trail of ghosts... some less significant characters (1, 2, or maybe even 3 steps-worth of ghosts).
My simplistic attempt at drawing it, using a capital 'O' trailed by asterisks:
Code: Select all
------------------ | | | O | | * | | * | | * | ------------------ ------------------ | | | * O | | * | | * | | | ------------------ ------------------ | | | * * | | * O| | | | | ------------------
Convincing people that 0.9999... = 1 since 2012
- testtubegames
- Site Admin
- Posts: 1164
- Joined: Mon Nov 19, 2012 7:54 pm
Re: A rendering program in lua
Ah, whoops, that's why there's a 'preview' button... and a 'code' block. Thanks for fixing it up so I don't look (as) crazyrobly18 wrote:That's a good idea, but I feel it would require a lot of variables. However, I'll try it when i think of a way to do it. Also, fixed your spaces.
-
- Posts: 585
- Joined: Sun Jul 28, 2013 8:40 pm
Re: A rendering program in lua
Why don't you go in and edit your post to place the code block in there?
Nobody ever notices my signature. ):
- robly18
- Posts: 413
- Joined: Tue Jun 04, 2013 2:03 pm
Re: A rendering program in lua
Because then I'd look like an idiot who fixed up nothingexfret wrote:Why don't you go in and edit your post to place the code block in there?

Convincing people that 0.9999... = 1 since 2012