PDA

View Full Version : lightning,colorize,scaling,static blocks,etc



sinister
02-01-2003, 11:10 PM
is it possible to do lightning effects in ddraw? i think i've seen it in razor1911 demos if i'm not mistaken,but it could've been d3d? anyways please look @ the following example first to allow me 2 explain...

http://www.scene.co.za/scene_cracktro_beta2.zip

there is a fireball moving in a horizontal 8 to the top left,now this sprite,must now throw a lightning effect to each side,of a specific color(perhaps alpha blending?).also,if u can also tell me how 2 colorize a sprite,and rotate/scale it in delphiX,it would be most appreciated.

also,say we have a window like the following,with 2 blocks inside

----------------------
| |
| --------- |
| | x | |
| --------- |
|---------------------

ok,say we are gonna do a star effect in the outer block,but we dont want to do anything in the inner X block,how can that be accomplished? can it work like lets say a layer effect?

and now,the bottom text part is a little korny,what i've done,is i've created a bmp of 10000x60 pixels,wif the text inside,which comes to about 1.5mb of junk.is'nt there a easier way of doing this? perhaps a 300x300px image wif fonts inside that can be used?

thanx in forward for which info can be given
//admin@scene.co.za

sinister
02-01-2003, 11:17 PM
argh,the lame block effect did'nt work in above post :(
let's try that again.please clix0r to http://www.scene.co.za/lameblock.jpg
(8,094 bytes)

TheLion
02-01-2003, 11:32 PM
I only understand parts of what you want to do, however since my eyes are slowly disappearing behind my eyelids it could also be me...

From what I understand out of the star effect question, I would say you draw the first block, then draw the effect and then draw the 2nd block over it... Of course if you want the 2nd block to be in the effect too, then you draw the second block over the first, then the effect and finally put the text in it...

Your second question, yes there is an easier way... Store all the letters of the alfabet (and maybe numbers) in a bitmap, make sure all the letters have the same rectangular size and a clfuchsia background, then u can simply read out the text from the bitmap by using CopyRect and if you write a good function for it you could simply pass text to the function and make the function determine what the number of the letter is in the alfabet (which is easy to determine just look at an ASCII table) and then the function just picks the image it needs from the tiled (font) bitmap and draws the letter transparent over the block...

The lightning question I don't know, however I don't think it's (standard) possible in DXDraw. It could have been a D3D trick however, but I'm not very into that... :(

Hope this helps a little :)

Alimonster
03-01-2003, 03:55 PM
You might be able to get something useful for lightning with a l-system (lindenmayer system), though I've not thought about lightning enough to say that it's definitely useful for you. Bung the term into google and see what comes up :).

Alternatively, you might want to go slightly over the top (http://nis-ei.eng.hokudai.ac.jp/~doba/images/sample/3ln.jpg) ^_^ with this paper (http://nis-lab.is.s.u-tokyo.ac.jp/~nis/abs_cgi.html#pg01-3), greatly simplified of course.

I think Sulaco (http://www.sulaco.co.za) has an OpenGL example with lightning between two spheres, if my memory serves. That might give you some ideas.

If you're looking to blend your lightning then I'd suggest Project Omega (http://www.blueworldtech.com/ds) instead of DelphiX. For one thing, it's under development, meaning you can hassle the dev'ers for features. Also, Bobby has made a sample for it that displays 2000 translucent sprites. There's absolutely no way that you could approach that with DelphiX, since you'd have to do translucency on the CPU the hard way. You probably won't need that much firepower yet, but it's nice to have it sitting around for later ;).

sinister
04-01-2003, 12:59 AM
thanx anyways dudes,i decided though that directx is'nt good enuff for very advanced 3d effects,so i'm gonna head into c++/opengl,and also cause i know c MUUUUCH better than pascal *shrug* :\

thanx again.
//admin@scene.co.za

cairnswm
04-01-2003, 04:02 AM
There are a number of font components that use a bitmap of text. The best one I've found is DXPowerFont which is included in the DXGui components.