I'd love to see it but it seems to crash on line 9 of the model loader because apparently io.load is not returning anything on my system. Can you not use the built-in filesystem stuff?Zilarrezko wrote:I'm putting my question here because I think I'm starting to clutter stuff up with my own topics.
So I've been working with 3D for the past few weeks. Mostly looking forward into concepts that I'll need in the future.
...
"Questions that don't deserve their own thread" thread
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: "Questions that don't deserve their own thread" thread
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: "Questions that don't deserve their own thread" thread
ah, Here's the same thing I believe, just using the Löve API instead of Lua's filesystem io.open. As far as I know it does the same thing, right down to the error in 3ddraw.Jasoco wrote:I'd love to see it but it seems to crash on line 9 of the model loader because apparently io.load is not returning anything on my system. Can you not use the built-in filesystem stuff?Zilarrezko wrote:I'm putting my question here because I think I'm starting to clutter stuff up with my own topics.
So I've been working with 3D for the past few weeks. Mostly looking forward into concepts that I'll need in the future.
...
- Attachments
-
- _Workspace.love
- Here's the fix
- (484.14 KiB) Downloaded 114 times
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: "Questions that don't deserve their own thread" thread
After racking my brain for much more time than I should have, and so much code changing and testing, I came upon a solution for you.
The following changes should remove the error: (Though I don't see anything draw)
Change the following line with the a, b, c, d to:
For some reason I guess a, b, c and d are being converted to strings instead of staying as numbers.
And secondly, you are passing your polygon points as an incorrectly structured table.
You're passing what would be like so: { { x, y }, { x, y }, { x, y }, { x, y } }
What you need to do is pass it as a flat table: { x, y, x, y, x, y, x, y }
This code helps stuff it all into a flat table, I'm sure there's a better way:
Of course I don't see anything being drawn, but the error is gone.
The following changes should remove the error: (Though I don't see anything draw)
Change the following line with the a, b, c, d to:
Code: Select all
local a, b, c, d = tonumber(face[t][1]), tonumber(face[t][2]), tonumber(face[t][3]), tonumber(face[t][4])
And secondly, you are passing your polygon points as an incorrectly structured table.
You're passing what would be like so: { { x, y }, { x, y }, { x, y }, { x, y } }
What you need to do is pass it as a flat table: { x, y, x, y, x, y, x, y }
This code helps stuff it all into a flat table, I'm sure there's a better way:
Code: Select all
local p = {}
for j = 1, #poly do
p[#p+1] = poly[j][1]
p[#p+1] = poly[j][2]
end
gfx.polygon("line", p)
Re: "Questions that don't deserve their own thread" thread
I'm trying to create a collider table, I think I tried almost everything, not sure how to handle adding and removing colliders (I want to add and remove bullet colliders in a top-down shooter)
all other values like in the tutorial
Code: Select all
bulletsCollider = {}
table.insert(bulletsCollider,Collider:addCircle(playerX,playerY,bulletRadius))
- Attachments
-
- test.love
- (21.62 KiB) Downloaded 259 times
Re: "Questions that don't deserve their own thread" thread
Is anyone aware of a way I can artificially bold a font? I find that my mock-ups in Photoshop often look much nicer because the text is more heavy-set where it's scrawny in-game.
I don't expect it to look identical, but what is there as far as font manipulation goes?
I don't expect it to look identical, but what is there as far as font manipulation goes?
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: "Questions that don't deserve their own thread" thread
Ah! got it!
you got me thinking, but I did it. Still have stuff behind you still rendering. I'm going to need another week to think about that. and like 5 weeks to implement it because I'm slow like that.
you got me thinking, but I did it. Still have stuff behind you still rendering. I'm going to need another week to think about that. and like 5 weeks to implement it because I'm slow like that.
- Attachments
-
- _Workspace.love
- (483.87 KiB) Downloaded 107 times
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: "Questions that don't deserve their own thread" thread
Well keep at it. If you're good enough, eventually you can have something as cool as this:
(A GIF that is once again completely outdated)
(A GIF that is once again completely outdated)
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: "Questions that don't deserve their own thread" thread
Dang, well... Don't think I'll get to where that gif is anytime soon. I'm not sure if I'll ever get to the point of doing shaders well enough to make any thing out of em. So spheres will just look like circles. But by taking some code from here and there, Jamie King for Culling and Oysi for the things that render behind you (although not by using clipping, which is probably better frame wise by not using clipping), I made a jump in development.
Of course though still, Concave polygon structures like the torus and the monkey head and kicking my arse by still rendering polygons behind the structure. I thought of a way to fix it through 2D collision detection and z vertex calculating, but it would require some serious frame loss.
Alas, just hitting walls now. Anyone know how to render textures to 3D triangles? I'd like to do that without changing code structure too much. But I know in the end I'll just be building it back up again to accommodate shaders (but I can't even get those to do something practical in 2D). Not sure where to go from here, but there is a weird bug when you spawn more than one type of object and then move around.
Here's my update, although I should probably stop posting here, I'm getting off topic :/.
Of course though still, Concave polygon structures like the torus and the monkey head and kicking my arse by still rendering polygons behind the structure. I thought of a way to fix it through 2D collision detection and z vertex calculating, but it would require some serious frame loss.
Alas, just hitting walls now. Anyone know how to render textures to 3D triangles? I'd like to do that without changing code structure too much. But I know in the end I'll just be building it back up again to accommodate shaders (but I can't even get those to do something practical in 2D). Not sure where to go from here, but there is a weird bug when you spawn more than one type of object and then move around.
Here's my update, although I should probably stop posting here, I'm getting off topic :/.
- Attachments
-
- _Workspace.love
- (501.15 KiB) Downloaded 100 times
- Cryogenical
- Prole
- Posts: 49
- Joined: Mon Apr 28, 2014 5:23 pm
Re: "Questions that don't deserve their own thread" thread
How should I go about making my window able to be toggled to windowed-borderless and back again?
Code: Select all
function love.keypressed(key, unicode)
if key == "5" then
end
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: "Questions that don't deserve their own thread" thread
Here's your magic function!Cryogenical wrote:How should I go about making my window able to be toggled to windowed-borderless and back again?
Code: Select all
function love.keypressed(key, unicode) if key == "5" then end
here's how I would do it just to make it what you said.
Code: Select all
local resizeable = false --Notice the spelling, not important, it's just for clarity
function love.keypressed(key, unicode)
if key == "5" then
resizeable = not resizeable
love.window.setMode(1080, 720, {resizable = resizeable}) --The key "resizable" Must be called resizable, no spelling mistakes
end
end
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 5 guests