How do do 'Solid wireframe'?

BlitzMax Forums/BlitzMax Programming/How do do 'Solid wireframe'?

Sokurah(Posted 2009) [#1]
'Solid wireframes'?

I've made several games with 'ordinary' glowing wireframe graphics. Thanks to Indiepath's texturedpoly module that's been an easy task.

Now, what if I want to do something that's solid? - here, look at this screenshot from Gravity Crash to see what I mean.



What I'd like to do is the effect where you have a solid or textured background on one side and nothing on the other.
I'm sure polygons would be involved but I have no idea how to do it - I'm simply not that bright. :o)

Any ideas?...perhaps a bit of code? ;)

Edit: damn, noticed a typing mistake in the title. It should have said 'How TO do ...'. Oh well, too late now. :(


Jesse(Posted 2009) [#2]
It looks like an image with a wireframe around it.


ImaginaryHuman(Posted 2009) [#3]
How about you create your environment as a tilemap and the images used for the tiles have alpha of 0 where you want the `sky`, draw your tilemap and then draw your glowy lines around the edges?


Corum(Posted 2009) [#4]
In that screenshot I could see:
1) lots of outlined polygons filled with a mask color to show a lower layer;
2) lots of outlined polygons flood-filled with a texture;
3) tile mapped background.

;-)


Sokurah(Posted 2009) [#5]
How about you create your environment as a tilemap and the images used for the tiles have alpha of 0 where you want the `sky`, draw your tilemap and then draw your glowy lines around the edges?

I'd considered that as a easy way of doing it but it would feel like cheating...and I'd have to basically run two engines on top of each other and struggle with a sh!tload of tiles too.
It wouldn't make sense with a wireframe game that has a gigantic memory footprint either (because of the tiles).

Doing it with tiles also have a few limitations as I'd be stuck with a static scenery which means that I wouldn't be able to do moving or perhaps even rotating scenery.

Like I said - not that I have anything planned right now, but I would like to do it 'the best way' if I ever get to it (which IS my plan). :)

No, I'd feel better with a 'pure' vector solution...if there is a good solution to it.


_JIM(Posted 2009) [#6]
Can't you draw the environment as textured polygons? Mapping the UVs to a texture should be as easy as:

U = (X / ScreenWidth) * Tile
V = (Y / ScreenHeight) * Tile


With slight adjustments to preserve the aspect ratio of the texture.

Then the glowy lines should be easy.


matibee(Posted 2009) [#7]
I had a play, trying to avoid arbitrary triangle tesselation because that looks bloody tricky :/

I used a square quadtree that tested if nodes were fully inside the geometry, intersecting the geometry (and hence subdivided) or fully outside. This gives a list of rects down to 1x1 pixel so it's not uber efficient. Thing is, this list of rects could be turned into one triangle list and drawn in one hit

A fairly simple optimisation would be to see if the node only hits one line and make a clipped poly for the node, instead of subdividing any further. This would also solve the issue where one pixel accuracy isn't really enough (it needs a line width of 2 to 3 to cover the edges properly).

Like I said, It was just a play. Nodes are given a random color to show them.



You'll need my primitive based collision mod to try this from here. Which in turn needs another mod :/




Sledge(Posted 2009) [#8]
Surely you could pick just about any 3D engine and render the outline geometry first, slightly larger than the 'fill' geometry? For example in MiniB3D it would be along the lines (arf!) of:



The speed of 'proper' 2D in Blitz3D/B3D SDK would mean you could do some neato stencil stuff if you opted for that language/API.