GL help (edge of map widget)

GL help (edge of map widget)

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

GL help (edge of map widget)

Post by KingRaptor »

So, I modified knorke's widget here, hoping to make it draw a cool VR grid around the map (see attached file). Unfortunately I can't figure out how to apply the texture to the quads (drawn with gl.Vertex). Halp?
screen00029.jpg
(31.77 KiB) Downloaded 3 times
Attachments
map_external_grid.lua
(Supposed to) draw a VR grid around map
(3.5 KiB) Downloaded 106 times
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: GL help (edge of map widget)

Post by knorke »

(i have no good understanding of gl)
This one draws 4 textured quads around the map:
http://pastebin.com/EuuSsw75
also draws some (flowing!!11) river but you can just comment that out ;)
At the least it is maybe helpful to compare why that draws textures and yours does not.
*look*look*
I think you also need to use TexCoord to tell it how it should the put the texture over the vertices. You do not use it at all atm.

Might also just be that the texture path is not found:
local gridTex = "LuaUI/Images/vr_grid.png"
I do like paths this:
groundTextureFileName = "LuaUI\\widgets\\moss8.png"
Attachments
mapbla.jpg
(225.18 KiB) Downloaded 3 times
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: GL help (edge of map widget)

Post by jK »

You might want to take a look at glTexGen.
(It creates the texture coordinates from the vertex positions, and so it saves you those glTexCoord calls after each glVertex)
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: GL help (edge of map widget)

Post by KingRaptor »

Well after some time fiddling with random bits like an idiot, I figured out how to use gl.TexCoord for what I wanted to do. So...done!

Image

Somehow it looked a lot cooler in my imagination :/ Ah well.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: GL help (edge of map widget)

Post by knorke »

maybe more suited for kernel panic?
still i think "map on grid" looks better than "map in void"
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: GL help (edge of map widget)

Post by luckywaldo7 »

Awesome.

Technically knorke it could fit any scifi game because even though you view the map from overhead, it doesn't really make sense for you to be a satellite or airborne unit if standard fog of war applies. What you are looking at is more likely a virtual display of the collective information accumulated from your various units.

So possibly you are looking at a display, or else the data is being fed directly into your brain and the resulting battlefield view is how it is interpreted.
Post Reply

Return to “Lua Scripts”