pixel wall

Blitz3D Forums/Blitz3D Programming/pixel wall

WillKoh(Posted 2004) [#1]
some users may get confused about me asking once for manipulating the internal polygons of an entity and then something all different but I'm doing a little of each..

To draw pixel graphics on a flat surface (that has active transparency/alpha bytes, and whose pixels will not be distorted because it's 3D or it's Z position) standing upright like a wall (in the face) of the user, how do I do that?

Should I use a sprite or a plane? Code example please, I know it must be simple, i'm just beginner-confused with the 3d mode rules...


Rob Farley(Posted 2004) [#2]
I think syntax error has done a sprite library in the code archives you might want to take a look at.


WillKoh(Posted 2004) [#3]
Oh, that's just the kind of answers I've already had and I thought I had to be more specific. A sprite library will be a lot of fancy stuff that does not describe the simple thing I want: pixelized drawing in 3d mode (because it alows alpha).


_PJ_(Posted 2004) [#4]
Sprites would do the job for individual and small-scale images. Planes would ony be useful for backgrounds etc. because they are so large. (Infinite in fact).

Have a look (Search in) these forums for decals too, because Im guessing thats the kinda thing you might need.


Ross C(Posted 2004) [#5]
Are you wanting to do bullet holes and such? I'm not quite sure what you mean, sorry :S


Rob Farley(Posted 2004) [#6]
WillKoh,

If you take a look in the code archives you can then find stuff that does about what you want, then if you don't understand parts of it you can ask specific questions.

We're not going to hold your hand to re-invent the wheel.

Do some research then ask specific questions.


WillKoh(Posted 2004) [#7]
I've been experimenting with positioning a sprite now, and there are two problems:

First the light - how can I set a light that will leave the colors of pixels as they where written/loaded to the texture bmp?

Second the position; in order to not resize the bitmap one must find that particular Z which leaves it intact (intact as if you do print-screen and compare 2d results in paint, that is). For the WinXP "Santa Fe Stucco" which is 256x256, the magic Z is 2.5 at 640x480 at camera zoom 1. For "River Sumida" which is 160x160 the magic Z is 4.0. I see no simple relationship - a func graph of magic Z would be curved I think, but there is ofcourse a formula to find the magic z, and thats what I need...


_PJ_(Posted 2004) [#8]
Hmm, Any ambient or hardware light will of course affect the color of your textures. To disable this, use EntityFX Entity,1

I see what you mean about the textures. Note that (As I only just found out here), Texture scaling is slightly different from normal Blitz units as it deals with relative UV values to the surface, rather than an actual value.

I hope you are testing your 'magic Z' number on a standard primitive. I dont think anyone's tested this before, so you may be able to determine the first graph function :)


Rob Farley(Posted 2004) [#9]
http://www.blitzbasic.com/codearcs/codearcs.php?code=456


_PJ_(Posted 2004) [#10]
Cool - so you can apply sprites as if drawing to 2d!

Good stuff, Rob!


Rob Farley(Posted 2004) [#11]
WillKoh, the other thing you've got to worry about with using 3D hardware to do 2D stuff is the texture sizes and 2^x sizes, some cards don't like non 2^x sizes and will scale to a 2^x therefore make it blurry and horrible.


WillKoh(Posted 2004) [#12]
Hm, well I to like 2^x sizes so that won't be a problem..

I tried that little sprite draw example (with the red sports car as mouse cursor) but because it doesn't have transparancy in it, and there's no bkg that could shine through, I wanted to apply those things. I tried drawing WinXP's "stucco" both as a std image and as a DrawImage3D/LoadImage3D thing, and dispite drawing it *before* the car/cursor, it (the all-solid "stucco") kept positioning itself above the cursor, making a test of transparancy impossible*.

I don't understand everything how SpriteControl works but that seems just weird...

* I know the car doesn't have transparancy but I replaced it...


WillKoh(Posted 2004) [#13]
oh c'mon, there gotta be some-one who can help me without promoting strange bloatware libraries...