Jump to content




[POLL] A 3D Renderer [Accepts Wavefront objs]


23 replies to this topic

Poll: Release Code

Do you want the source as it is right now? (Buggy and unfinished)

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#1 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 02 June 2016 - 08:08 PM

Old post:
Spoiler

UPDATE: So, I'm pretty much done, just a few problems to work out with clipping and then it will be done and I will release source.

Here's a nice video that demonstrates its current state:


UPDATE 2: So, I'm going to have a lot less time to work on this as I start my internship next week and have to leave town for the rest of this week. It struck me that some people might want the program as it is. It hurts me to release something that isn't finished, but I will not be able to work on it as much so I'm willing to make an exception if people want it.

Edited by Incinirate, 06 June 2016 - 09:46 PM.


#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 02 June 2016 - 09:59 PM

Now Yevano isn't the only one that can do magic.

#3 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 02 June 2016 - 10:11 PM

View PostCreator, on 02 June 2016 - 09:59 PM, said:

Now Yevano isn't the only one that can do magic.

Got a cube and an icosphere render too :3
Cube:
Spoiler
Icosphere:
Spoiler
They look strange because of the UV mapping on them doesn't suit the texture being applied, but other than that. :P

#4 Lignum

  • Members
  • 558 posts

Posted 03 June 2016 - 03:05 PM

View Postincinirate, on 02 June 2016 - 10:11 PM, said:

Got a cube and an icosphere render too :3
Cube:
Spoiler
Icosphere:
Spoiler
They look strange because of the UV mapping on them doesn't suit the texture being applied, but other than that. :P

I see wavefront in the first few frames :P. Does that mean it can render any model? I'd be thrilled to see the first Utah teapot in ComputerCraft.

#5 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 03 June 2016 - 07:48 PM

View PostLignum, on 03 June 2016 - 03:05 PM, said:

View Postincinirate, on 02 June 2016 - 10:11 PM, said:

Got a cube and an icosphere render too :3
Cube:
Spoiler
Icosphere:
Spoiler
They look strange because of the UV mapping on them doesn't suit the texture being applied, but other than that. :P

I see wavefront in the first few frames :P. Does that mean it can render any model? I'd be thrilled to see the first Utah teapot in ComputerCraft.

Yep, it can load any .obj
The renderer is mostly finished now, just smoothing out things with clipping, lighting, etc.

#6 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 03 June 2016 - 09:57 PM

View PostLignum, on 03 June 2016 - 03:05 PM, said:

--snip--
I'd be thrilled to see the first Utah teapot in ComputerCraft.

Your wish is my command:
Spoiler
Btw, the stale pixels around the edges of the teapot are caused by my gif recorder not the renderer.

Edit: The reason the teapot is gray is because the .obj I used had no texture mapping information in it, I checked, it had vertices, normals, and faces, but no vt. :P
If you can find a texture mapped version with a texture, I will make a new gif. ;)

Edited by incinirate, 03 June 2016 - 10:01 PM.


#7 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 03 June 2016 - 11:42 PM

Dude, this is awesome! Since you can do pretty much anything now, do a laptop :P

#8 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 04 June 2016 - 02:12 PM

Wow, this is extremely impressive!
I can barely transform 3D vertices into 2D and draw flat triangles (not even clipped haha)
Are you going to release the program/source soon?
Anyways, great job!

#9 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 04 June 2016 - 05:29 PM

View PostCrazedProgrammer, on 04 June 2016 - 02:12 PM, said:

Wow, this is extremely impressive!
I can barely transform 3D vertices into 2D and draw flat triangles (not even clipped haha)
Are you going to release the program/source soon?
Anyways, great job!

Thanks!
And I will release the source along with a tutorial of how to properly use it as soon as I fix some issues with my clipping algorithm and optimize some more. Right now the issue I am experiencing is that it takes longer to write data into my screen buffer than it takes to actually draw the buffer to the screen which is totally unacceptable. :P

Edited by Incinirate, 04 June 2016 - 05:30 PM.


#10 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 05 June 2016 - 12:01 AM

The real problem is what happens when it takes longer for you to draw the display than it takes for repeated key events to enter the event queue... :(

#11 Luca_S

  • Members
  • 407 posts
  • LocationGermany

Posted 05 June 2016 - 06:21 AM

Can it render this crazy thing I found on the internet. https://www.dropbox....mj/bb8.obj?dl=0

Found here: http://tf3dm.com/3d-.../bb8-35865.html

#12 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 05 June 2016 - 04:47 PM

View PostLuca_S, on 05 June 2016 - 06:21 AM, said:

Can it render this crazy thing I found on the internet. https://www.dropbox....mj/bb8.obj?dl=0
Found here: http://tf3dm.com/3d-.../bb8-35865.html
Ich bezweifle das, dies war nie fur grosse Modelle wie das bedeutete Ihnen zur Verfugung gestellten, weil Lua Zahlknirschens Maschine nicht sein. Aber, ich werde versuche es sowieso. Obwohl nur raten, da die Teekanne hatte 600 Eckpunkte, und die bb8 hatte 9000. Ich bin gespannt zu sehen, wie langsam es lauft.

Ich habe versucht, jetzt ist es an dieser Stelle, ja, es macht es in Ordnung, aber es lauft bei etwa 0,5fps xD

Translation:
I doubt it, this was never meant for huge models such as the one you provided as Lua (as implemented in computercraft) isn't a great number crunching machine. But, I will try it anyways. Although just guessing since the teapot had 600-700 verts, and the bb8 model has 9000 verts, I'm curious to see how slow it will run.

I have now tried it at this point, yep, it renders it fine, but it runs at about 0.5fps xD

Edited by Incinirate, 05 June 2016 - 08:47 PM.


#13 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 June 2016 - 01:26 AM

I for one am much more interested in the screenshot than the frame rate. ;)

#14 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 06 June 2016 - 01:32 AM

View PostBomb Bloke, on 06 June 2016 - 01:26 AM, said:

I for one am much more interested in the screenshot than the frame rate. ;)

Quite difficult because it crashes with what I can only assume is a too long without yielding when I try to move the camera around. Will try to reduce the vertices with blender or something and try again.

#15 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 June 2016 - 01:36 AM

You may already be aware, but if you find you really do need to make your script yield more often, manually queuing and than pulling an event is generally the fastest way to go about it (as opposed to doing sleep(0), for eg).

local function snooze()
	local myEvent = tostring({})
	os.queueEvent(myEvent)
	os.pullEvent(myEvent)
end

The trick would be to adapt the function to listen for further input events, and set some bools indicating whether the current view should move again after the current frame has finished rendering.

Edited by Bomb Bloke, 06 June 2016 - 01:38 AM.


#16 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 06 June 2016 - 01:23 PM

View PostBomb Bloke, on 06 June 2016 - 01:36 AM, said:

You may already be aware, but if you find you really do need to make your script yield more often, manually queuing and than pulling an event is generally the fastest way to go about it (as opposed to doing sleep(0), for eg).

local function snooze()
	local myEvent = tostring({})
	os.queueEvent(myEvent)
	os.pullEvent(myEvent)
end

The trick would be to adapt the function to listen for further input events, and set some bools indicating whether the current view should move again after the current frame has finished rendering.

Hmm, maybe I could do something sneaky like this
local function doLogic()
    os.queueEvent("FinishedQueue")
    local e,p1,p2,p3,p4,p5
    repeat
        e,p1,p2,p3,p4,p5 = os.pullEvent()
        if e=="key" then
             --perform logic
        end
    until e=="FinishedQueue"
end


#17 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 June 2016 - 02:02 PM

Exactly, yes.

#18 Luca_S

  • Members
  • 407 posts
  • LocationGermany

Posted 06 June 2016 - 08:17 PM

View PostIncinirate, on 05 June 2016 - 04:47 PM, said:

View PostLuca_S, on 05 June 2016 - 06:21 AM, said:

Can it render this crazy thing I found on the internet. https://www.dropbox....mj/bb8.obj?dl=0
Found here: http://tf3dm.com/3d-.../bb8-35865.html
Ich bezweifle das, dies war nie fur grosse Modelle wie das bedeutete Ihnen zur Verfugung gestellten, weil Lua Zahlknirschens Maschine nicht sein. Aber, ich werde versuche es sowieso. Obwohl nur raten, da die Teekanne hatte 600 Eckpunkte, und die bb8 hatte 9000. Ich bin gespannt zu sehen, wie langsam es lauft.

Ich habe versucht, jetzt ist es an dieser Stelle, ja, es macht es in Ordnung, aber es lauft bei etwa 0,5fps xD

Translation:
I doubt it, this was never meant for huge models such as the one you provided as Lua (as implemented in computercraft) isn't a great number crunching machine. But, I will try it anyways. Although just guessing since the teapot had 600-700 verts, and the bb8 model has 9000 verts, I'm curious to see how slow it will run.

I have now tried it at this point, yep, it renders it fine, but it runs at about 0.5fps xD
I wanna see it rendering this :D Also why did you wrote it in german too?

#19 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 06 June 2016 - 09:03 PM

View PostLuca_S, on 06 June 2016 - 08:17 PM, said:

--snip--
Also why did you wrote it in german too?

Ich sah, dass du aus Deutschland warst, und ich spreche Deutsch.

Translation:
I saw that you were from Germany and I speak German.

#20 Luca_S

  • Members
  • 407 posts
  • LocationGermany

Posted 07 June 2016 - 06:51 PM

View PostIncinirate, on 06 June 2016 - 09:03 PM, said:

View PostLuca_S, on 06 June 2016 - 08:17 PM, said:

--snip--
Also why did you wrote it in german too?

Ich sah, dass du aus Deutschland warst, und ich spreche Deutsch.

Translation:
I saw that you were from Germany and I speak German.

:D Nice.

Nice way of getting around showing me the model :P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users