Texturing Meshes at an Angle

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Texturing Meshes at an Angle

Post by Davidobot »

MasterLee wrote: Tue May 23, 2017 6:30 pm Finally i found an solution to render trapezoid
Then in the fragment shader i divide s by p
Could you post a .love file to showcase this?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Texturing Meshes at an Angle

Post by MasterLee »

Press ↑,↑,→ to go to the actual experiment.
Next i will try to do the same with Quadrilateral but it will be hard math.
Attachments
bunt.love
(10.42 KiB) Downloaded 138 times
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Texturing Meshes at an Angle

Post by Jasoco »

MasterLee wrote: Tue May 23, 2017 6:30 pm Finally i found an solution to render trapezoid
Bildschirmfoto von »2017-05-23 20-26-04«.png
i used following data: (x,y)(s,t,p)

Code: Select all

             ((-1,-1),(0,0,1)),
             ((-.1,+1),(0,1,.1)),
             ((+1,-1),(1,0,1)),
             ((+.1,+1),(.1,1,.1)),
Then in the fragment shader i divide s by p
The problem is it's still not perspective. Note that the squares at the "far" top end are still the same height as the ones at the "close" bottom end.
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Texturing Meshes at an Angle

Post by MasterLee »

Jasoco wrote: Fri May 26, 2017 6:53 am The problem is it's still not perspective. Note that the squares at the "far" top end are still the same height as the ones at the "close" bottom end.
I did the non perspective on purpose because it is more difficult and was the one i wanted.
Perspective quad would be easier.
That was not what i wanted:
Bildschirmfoto von »2017-05-26 12-52-03«.png
Bildschirmfoto von »2017-05-26 12-52-03«.png (50.67 KiB) Viewed 5833 times
I wanted the following:
Bildschirmfoto von »2017-05-26 12-52-09«.png
Bildschirmfoto von »2017-05-26 12-52-09«.png (51.56 KiB) Viewed 5833 times
Btw.: What about an if CGA Cards have 3D acceleration jam
Attachments
bunt.love
(11.31 KiB) Downloaded 139 times
therektafire
Prole
Posts: 12
Joined: Mon May 22, 2017 3:45 am

Re: Texturing Meshes at an Angle

Post by therektafire »

from the cpml github page
Clone the repository and require it, or if you prefer luarocks: $ luarocks install --server=http://luarocks.org/dev cpml. Add --tree=whatever for a local install.
How exactly does one require a git repo in a lua script -_- Do I require the /modules directory?
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Texturing Meshes at an Angle

Post by Davidobot »

MasterLee wrote: Fri May 26, 2017 10:39 am Perspective quad would be easier.
That was not what i wanted: <what Jasoco and I want>
Is it just me, or is something off about how it stretches things? Like the bottom is too stretched out. This is how it would look like in a proper perspective way (using pers.lua)
Image
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Texturing Meshes at an Angle

Post by MasterLee »

Davidobot wrote: Mon May 29, 2017 3:33 pm Is it just me, or is something off about how it stretches things? Like the bottom is too stretched out. This is how it would look like in a proper perspective way (using pers.lua)
It is just you:

You have 16:9 i have 4:3 screen aspect ratio.
Furthermore the upper part of your quad seems to have an depth of 9 while mine has an depth of 10. (Assumed that both start at depth 1)
That is why mine shows so stretched, it is simply not the same viewing angle and position.

Also you Texture has 19 rows where mine has only 16
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: Texturing Meshes at an Angle

Post by 4aiman »

Sorry for necroposting, but is there a version that works on Android build of love2d?
Attachments
Screenshot_2018-03-17-20-17-54-0484032658.png
Screenshot_2018-03-17-20-17-54-0484032658.png (120.48 KiB) Viewed 4619 times
Post Reply

Who is online

Users browsing this forum: No registered users and 59 guests