How to properly use "newMesh"?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
LoneArtisan
Prole
Posts: 12
Joined: Thu Apr 11, 2013 6:20 pm

How to properly use "newMesh"?

Post by LoneArtisan »

Nil
Last edited by LoneArtisan on Mon May 26, 2014 8:33 pm, edited 1 time in total.
You know that moment when you finally do that thing you've been trying to accomplish for hours and you finally get it exactly right? No matter how small the task was, it's one of the greatest things that could happen when you're programming!
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 1:42 am, edited 2 times in total.
User avatar
LoneArtisan
Prole
Posts: 12
Joined: Thu Apr 11, 2013 6:20 pm

Re: How to properly use "newMesh"?

Post by LoneArtisan »

Nil
Last edited by LoneArtisan on Mon May 26, 2014 8:33 pm, edited 3 times in total.
You know that moment when you finally do that thing you've been trying to accomplish for hours and you finally get it exactly right? No matter how small the task was, it's one of the greatest things that could happen when you're programming!
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 1:41 am, edited 2 times in total.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: How to properly use "newMesh"?

Post by slime »

I added a couple simple examples to the [wiki]love.graphics.newMesh[/wiki] wiki page.
User avatar
LoneArtisan
Prole
Posts: 12
Joined: Thu Apr 11, 2013 6:20 pm

Re: How to properly use "newMesh"?

Post by LoneArtisan »

Nil
Last edited by LoneArtisan on Mon May 26, 2014 8:35 pm, edited 1 time in total.
You know that moment when you finally do that thing you've been trying to accomplish for hours and you finally get it exactly right? No matter how small the task was, it's one of the greatest things that could happen when you're programming!
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: How to properly use "newMesh"?

Post by slime »

All computers which can run LÖVE can also use meshes. Are you sure you're running version 0.9.0?
User avatar
LoneArtisan
Prole
Posts: 12
Joined: Thu Apr 11, 2013 6:20 pm

Re: How to properly use "newMesh"?

Post by LoneArtisan »

Nil
Last edited by LoneArtisan on Mon May 26, 2014 8:35 pm, edited 1 time in total.
You know that moment when you finally do that thing you've been trying to accomplish for hours and you finally get it exactly right? No matter how small the task was, it's one of the greatest things that could happen when you're programming!
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: How to properly use "newMesh"?

Post by Ref »

Thanks slime for the mesh examples.
They work for me.

Minor point in your example containing function CreateTexturedCircle(image, segments)
The following code:

Code: Select all

    -- Create the vertices at the edge of the circle.
    for theta=0, math.pi*2, (math.pi*2)/segments do
should really be:

Code: Select all

for theta=0, math.pi*2*(1+1/segments), (math.pi*2)/segments do
Otherwise, at some segments choices (12,16, ...) you get missing sectors.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: How to properly use "newMesh"?

Post by slime »

LoneArtisan wrote:Yes. When I double click Love.exe, I see the baby with the glasses. To run the game, I drag the folder, with the main file inside, to Love. I even copied and pasted the exact sample code you added from the wiki but I still get the blue error screen above.
Just to make sure: you're using the release version of 0.9.0 from the homepage, right? There was a time period while 0.9.0 was being developed when love.graphics.newMesh didn't exist yet but the new no-game screen did (and semi-nightly Windows builds were being created as well), but that was several months ago.
Ref wrote:Otherwise, at some segments choices (12,16, ...) you get missing sectors.
Fixed, thanks.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot] and 10 guests