Joined: 17 Nov 2005, 02:43 Location: Raegquitting Spring on 04/24/12
Code:
function widget:GetInfo() return { name = "GeoVent Texture Placer", desc = "Places Geovent Textures", author = "Forboding Angel", date = "03/30/2012", license = "Public Domain", layer = 0, enabled = true -- loaded by default? } end
local function geoTextures() local features = Spring.GetAllFeatures() for i = 1, #features do local fID = features[i] if FeatureDefs[Spring.GetFeatureDefID(fID)].geoThermal then local fx, fy, fz = Spring.GetFeaturePosition(fID) --place texture on map here end end end
Would someone help finish this widget? It is to include in maps so that you can place geovents with lua, and still have the geovent textures drawn on the map (same basic idea as drawing metal textures on the map).
--place texture on map here << This line is where the code for actually drawing the image should go, but I don't have the foggiest idea how to do it. Anyone feel like taking a stab at it?
Joined: 17 Nov 2005, 02:43 Location: Raegquitting Spring on 04/24/12
Have you seen that monstrosity of a widget? That was my first idea... I gave up that idea in a hurry.
I see where the texture is being placed, but it's drawing a box to place the texture in, which is all fine and good, but I don't understand enough of what I'm reading to use it.
DrawGroundQuad doesn't work as you might believe from the description in the wiki. If the terrain is not flat enough, the ground texture will clip through. I basically wrote a hack around that problem. My best guess would be that the engine calculates the normal of a quad. But in reality spring terrain is probably drawn with triangle strips(more efficient than drawing quads). That would mean there are two normals(one for each polygon half of the quad). So to draw it perfectly you would calculate those normals and apply the texture(which might have to be drawn in halves). Although since DrawGroundQuad doesn't work(and devs didn't fix it), it might be more difficult than that.
Joined: 07 Feb 2005, 21:30 Location: Cheese factory
Okey as I thought, I'm wrong.
I know nothing about dynamic tessellation or what it implies. Only the frustrating outcome. My experience with opengl is limited to writing a very basic heightmap renderer as seen here. But I hope to learn more in the future.
I guess this is as close to an explanation as we'll have..
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum