Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: nikitouzz on October 04, 2012, 03:54:15 pm
-
Hi , I made a game with use the raycasting :) i would make a texture, but my texture bug completely ^^ (I'm french)
(http://desmond.imageshack.us/Himg221/scaled.php?server=221&filename=3d1s.gif&res=landing)
I have this sprite :
[AA55AA55AA55AA55]->pico and i would extract the line corresponding at the modulo of the position of the ray between 0 and 7 :)
and how drawn a line from different size ? my solutions is extremely big and very not fast....
thank's :)
cordially
YESSSSSSSSSSSSSSSS the textur function ;) and I make a little floorcasting ^^ ( it is not a right floorcasting ^^)
(http://imageshack.us/scaled/landing/59/3d3p.gif)
EDIT : the game run at full with a little pause ^^ it's very not fast ^^
-
To get the vertical line, just rotate the sprite 90 degrees right and then you add the line you want. The result is the vertical line from bottom to top.
[whatever your sprite is]->Pic0
.L is the line number (0=leftmost, 7=rightmost)
{RotC(Pic0)+L}->V
.V is the bit mask of the vertical line. MSB = bottom pixel, LSB = top pixel
EDIT: When you only use that sprite you said it doesn't need to be turned because it is the same then.
And L (without *8 ) should be correct.
-
:O rotate the sprite is a very good solution :) thank's most :)
EDIT : it's L*8 not L ;)
-
On an off-topic note, I like how the texture has no outline in the screenshot above. I wish more raycasters used such textures so games won't always look like you are in a tunnel.
-
Yeah, it is probably the fastest way to do it. If you don't need the sprites anywhere else, just store them rotated. That is faster and takes less memory. ;)
Btw, your raycaster looks awesome so far. I built one myself last week. Does yours run at 6 mHz or at 15 mHz?
-
dj'o : it's bug :p but if you love the texture I can make two programm with one witch have this texture ;)
can you answer at my second question please ? ^^ if you know :)
-
Yeah I know. I just thought the lack of an outline made it unique lol. And sadly I can't help since I never used raycasting before.
-
can you answer at my second question please ? ^^ if you know :)
What do you mean with a "a line with a different size"? One that is wider than one pixel?
When you only need vertical or horizontal lines, you should use the Rect( command. It is a lot faster than Line( and you can adjust the width.
-
no ^^ I would write the line of the texture in a differente size... how make this ?
-
I don't know, can you post the solution you came up with so maybe we can optimize that.
-
I extract the number (1 or 0) and i divise the size of line by 8 enregistred in W and I drawn the pixels multiplicated by the number W ...it's very long...
:for(8 )
:Size/8->W
:extract the number (with routine unoptimisable) 0 or 1
:for((0 or 1)+W)
:pxl-on(X,Y) or pxl-off(X,Y)
:Y++
:End
:End
i make this, I don't post the code in the totality because my 84+ is not accessible.
-
Why do you have to multiply with W at the end? I don't get the point of that. Can you post that part of your code?
-
:for(8 )
:extract the number (with routine unoptimisable)->W
:for(Size/8)
:W=1?pxl-on(X,Y)
:W=0?pxl-off(X,Y)
:Y++
:End
:End
-
Are you doing clrdraw every frame? That would make the pxl-Off redundant.
-
yes I use the routine of runer112 than faster clrdrawn per frame
-
Which routine?
-
ᴇ80FF→{L₆+11}ʳ
Copy(L₆+11,-1,11)ʳ
Copy(,L₆+756,12)
ᴇ0100→{L₆+22}ʳ
Copy(L₆+22,-1,9)ʳ
Copy(-1,+12,61*12)
-
But this clears the whole screen, right?
-
yes the whole screen
-
Ok then maybe do something like this:
H/8->S .H is the wall height in pixels
For(8)
If pixel is set
Rect(X,Y,S,1)
End
Y+S->Y
End
-
thank,s :) can make :
H/8->S .H is the wall height in pixels
For(8)
If pixel is set
Rect(X,Y,S+Y->Y,1)
End
End
I will try morning :) thank's :)
-
To test if whether a pixel is set you could make a simple routine that shifts the byte right by one and checks for carry.
-
yes i will think's about tomorrow :) thank's
-
Drawing the text on the right side every frame is very slow. You should draw it once before the game and then only clear the 64x64 px area. You could use Copy(, Fill( and/or a for( loop to achieve that.
-
non i use one simple routine :
:0→r1
:for(768)
:{str1+r1} or {L6+r1→r2}→r2
:r1++
:End
I define the pic in the calculator before the compilation, beacause the command text() or text is very slow....
in the begin, I clrear the 64x64 part of the screen par frame but it's not fast
-
Ah, that makes sense now. Have you tested the version with Rect(?
-
yes, I don't understand because one i have one bugs in rapport with the size of line... i think's that monday this bug will be solved :) ( grammar is horrible ^^ )
-
I agree with DJ, I think the texture bug makes a neat visual effect. ^^
-
Same here, it's looking nice that way :D
-
;) I don't understand all the message and google translation is not my friends ;) but thank's
HS: all people like the pony ? :) as juju :)
-
im not sure why ponys are all the rage but what is your first langauge? I think I might be able to show you some tips on shortened messages that arent understood by google translate
-
I'm frenche, i speack little english, but I don't like google translate
-
Understandable. Google translate is pretty terrible. D:
-
I make a texture ;)
(http://imageshack.us/scaled/landing/59/3d3p.gif)
-
Looks very nice. I like how youhave it so it is not full wall height. :)
If only raycasting in Axe supported transparency at a decent framerate, you could even have a background.
-
hum I see as i make....
I succed the greyscale of my raycaster but isn't beautiful, because my programms is very slow...
-
If you want beautifull grayscale, you can put the dispgraph^r in an interrupt routine
-
If you want beautifull grayscale, you can put the dispgraph^r in an interrupt routine
Yeah, ^This (http://ourl.ca/17145/318621) ;)
-
What about when the next frame is loaded (assuming he moves or that there is stuff moving on the screen)? Wouldn't there be flickering everytime he moves around?
-
ben_G :i t's very difficult, because I use one special technical for draw the pixels ^^ and I draw all the pixels througout the loop directly in the L6 list...
no Dj_o :)