Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ben_g

Pages: 1 ... 54 55 [56] 57 58 ... 71
826
Miscellaneous / Re: The Latest Ubuntu Installer Rocks
« on: July 30, 2011, 07:40:33 pm »
So you can do other stuff while installing an OS? That's cool.

The only way i could run an application while windows was installing, was using an other computer.

827
Miscellaneous / Re: The Latest Ubuntu Installer Rocks
« on: July 30, 2011, 07:28:12 pm »
can't you keep running applications while something is installing with almost all installers?

btw: what is ubuntu?

828
TI Z80 / Re: AR Code Generator (Pokemon)
« on: July 30, 2011, 05:32:39 pm »
use wabbitemu?

829
Miscellaneous / Re: Tutorial Request Thread
« on: July 30, 2011, 05:30:21 pm »
Two, a tutorial, probably by thepenguin77, about how he made his 3d polygon engine thingy for star fox. That, and/or how such a beast could be translated to Axe.
When you only want solid polygons, polygon 3D engines aren't that hard to make. Mine is almost entirely based on this wikipedia page: http://en.wikipedia.org/wiki/3D_projection .
I would suggest first trying it in an easyer langue than asm, but if you can do signed 8.8 fixed point math in axe (I don't know much abouth axe), then you can also directly write it in axe.

830
Math and Science / Re: interpolation
« on: July 30, 2011, 02:49:09 pm »
actually i was trying to find a way to do fake texture correction based on the shape of the quad, becouse, with affine texture mapping, a wall looked from an angle looks like this:

When you look at this, it looks like it's textured well, but when you look a bit closer, you see that the texels (pixels of the texture) all have the same width, while the height is mapped correctely. This gives the optical illusion that the texels look longer on the right side than on the left side, becouse the texels on the right side are actually further away, thus they should be smaller.

Now look at this picture:

this looks more realistic: the texels on the far side are smaller than the texels closer to the 'camera'. I want a way to fake this, becouse for texture correction, a lot of complex fixed-point calculations needs to be done, which would make it very slow. I don't really know if what i said in my first post will have the right effect, but actually, I want to calculate what texel should be drawn at a location so the texture is mapped like in the secound image, but this based on the height of the quad, and it's texture coordinates. I think everybody would agree that the secound image looks a lot more 3D than the first image, while they have exactely the same shape.

I hope i explaned it correctly and that you don't find it annoying that i mainly use images to explain it.

831
Other Calculators / Re: Where did you get your calcs from?
« on: July 30, 2011, 02:27:06 pm »
I got my 84+ from school

832
Math and Science / Re: interpolation
« on: July 29, 2011, 07:08:17 pm »
Yes, it's for my polygon 3d engine.

I was already planning to use it to calculate the texture coordinates of points every 5 or 10 pixels or so, depending on the size of the quad, and then calculate the rest of them with linear interpolation. But i still don't really get how i should calculate those reference points. (if they are easyer and/or faster to calculate for triangles, then say so. I only use quads becouse I really messed it up with my routines for affine texture mapped triangles) and if you said that in your post, then could you please explain it a bit more? I didn't understood your post very well and google translate just gave me a bunch of random words.

And yea, the quads will all be planar, so no skew quadrilaterals (I hope google translate has translated this correctely)

btw: thanks for your quick reply

833
Miscellaneous / Re: Advertising Posts on IRC
« on: July 29, 2011, 06:57:49 pm »
Is it okay to say on IRC that you've edited your post when you've added something important to a post, to avoid double-posting?

834
Official Contest / Re: Nspire Game Contest: Who's participating
« on: July 29, 2011, 06:46:37 pm »
Well, I don't think I will participate, because I'm at my grandparents house, and I did not bring my calc...
When I'll go back home, It will only remain one week.
one week is more than enough. Look at sirCmpwn's contest entry ;)

835
Math and Science / interpolation
« on: July 29, 2011, 06:02:02 pm »
I want to calculate the value of a point, based on the position of the point between 4 other points with each an other value.
an image to illustrate what I'm trying to say:

In this image, there are 4 points with a given value of a and a point between those 4 points which has got an unknown value of a. I now want to know how i can calculate value a of that point, based on the position of that point so that when x=x1 and y=y1, a=a1=1, and when x=x2 and y=y2, a=a2=2, and so on. And when point (x,y) is in the middle of (x1,y1) and (x2,y2), a should be the average of a1 and a2, so a=1.5.

Is there a formula which i can use to interpolate the a value of a point between the a values of the other points?

836
The prizm community will probably grow a lot in september, when students at some schools have to buy one.

I only have an 84+ becouse my school forced me to buy one. If this wouldn't have happened, i wouldn't be programming z80. I think this is how most of us got started with developping calc programs and games, and to many students the same will happen.

BTW: I think the prizm comunity will grow faster than those of any ti calculator, mainly becouse casio doesn't hate the calculator comunity, unlike TI.

837
Official Contest / Re: Nspire Game Contest: Who's participating
« on: July 28, 2011, 06:52:45 pm »
I mean in Europe (from experience on forums in the past few years) typically most people don't care enough about calculators to post on calc forums during vacations, let alone program for calcs then, so as a result, almost our entire european Nspire userbase is gone and TI-BANK is very very quiet.
I'm from Europe and i care enough abouth calcs to keep programming them and posting on calc forums during summer

But I won't be participating becouse i don't have an nspire (I never even saw one IRL, actually)

838
ASM / Re: Texture drawing
« on: July 28, 2011, 06:31:46 pm »
I've just rewritten the routine, but it doesn't draw anything. Not a single pixel :( .
What am I doing wrong?
Spoiler For the code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;TexQuad
;in: x1, y1, u1, v1, x2, y2, u2, v2, x3, y3, u3, v3, x4, y4, u4, v4
;out: textured quad is drawn to the buffer
TexQuad:
  ld a, (x1)
  ld b, a
  ld a, (x2)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y1)
  ld b, a
  ld a, (y2)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dx1), hl
  ld a, (x1)
  ld b, a
  ld a, (x3)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y1)
  ld b, a
  ld a, (y3)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dx2), hl
  ld a, (x2)
  ld b, a
  ld a, (x4)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y2)
  ld b, a
  ld a, (y4)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dx3), hl
  ld a, (x3)
  ld b, a
  ld a, (x4)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y3)
  ld b, a
  ld a, (y4)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dx4), hl
  ld a, (u1)
  ld b, a
  ld a, (u2)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y1)
  ld b, a
  ld a, (y2)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (du1), hl
  ld a, (u1)
  ld b, a
  ld a, (u3)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y1)
  ld b, a
  ld a, (y3)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (du2), hl
  ld a, (u2)
  ld b, a
  ld a, (u4)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y2)
  ld b, a
  ld a, (y4)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (du3), hl
  ld a, (u3)
  ld b, a
  ld a, (u4)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y3)
  ld b, a
  ld a, (y4)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (du4), hl
  ld a, (v1)
  ld b, a
  ld a, (v2)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y1)
  ld b, a
  ld a, (y2)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dv1), hl
  ld a, (v1)
  ld b, a
  ld a, (v3)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y1)
  ld b, a
  ld a, (y3)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dv2), hl
  ld a, (v2)
  ld b, a
  ld a, (v4)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y2)
  ld b, a
  ld a, (y4)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dv3), hl
  ld a, (v3)
  ld b, a
  ld a, (v4)
  sub b
  ld h, a
  ld l, 0
  push hl
  ld a, (y3)
  ld b, a
  ld a, (y4)
  sub b
  ld d, a
  ld e, 0
  pop hl
  call divFP
  ld (dv4), hl
  ld a, (x1)
  ld h, a
  ld l, 0
  ld (tx1), hl
  ld (tx2), hl
  ld a, (u1)
  ld h, a
  ld l, 0
  ld (tu1), hl
  ld (tu2), hl
  ld a, (v1)
  ld h, a
  ld l, 0
  ld (tv1), hl
  ld (tv2), hl
  ld a, (y1)
  ld (ty), a

;TODO: plot first line

  ld a, (y1)
  inc a
  ld (ty), a

QuadDrawLoop1:
  ld hl, (tx1)
  ld de, (dx1)
  add hl, de
  ld (tx1), hl
  ld hl, (tu1)
  ld de, (du1)
  add hl, de
  ld (tu1), hl
  ld hl, (tv1)
  ld de, (dv1)
  add hl, de
  ld (tv1), hl
  ld hl, (tx2)
  ld de, (dx2)
  add hl, de
  ld (tx2), hl
  ld hl, (tu2)
  ld de, (du2)
  add hl, de
  ld (tu2), hl
  ld hl, (tv2)
  ld de, (dv2)
  add hl, de
  ld (tv2), hl

  ld hl, (tx1)
  ld (temp), hl      ;x = temp

QuadPlotLoop1:
  ld hl, (tx2)
  ld de, (tx1)
  subFP
  push hl
  ld hl, (temp)
  ld de, (tx1)
  subFP
  pop de
  call DivFP
  ld (temp2), hl   ;T = temp2
  ld hl, $0100
  ld de, (temp2)
  subFP
  ld bc, (tu1)
  call MulFP
  push de
  ld hl, (temp2)
  ld bc, (tu2)
  call MulFP
  pop hl
  add hl, de
  ld a, h
  ld (temp3), a      ;u = temp3
  ld hl, $0100
  ld de, (temp2)
  subFP
  ld bc, (tv1)
  call MulFP
  push de
  ld hl, (temp2)
  ld bc, (tv2)
  call MulFP
  pop hl
  add hl, de
  ld a, h
  ld (temp3+1), a      ;v = temp3+1
;Get the pixel at (u,v) from the texture
  ld   hl, (temp3+1)
  ld   h, 0

  ld   de, texture
  add   hl, de

  ld   a, (temp3)
  ld   b, a
  inc   b
  ld a, (hl)
shiftLoop1:
  rl   c
  djnz   shiftLoop1

  push af
  ld a, (ty)
  ld l, a
  ld de, (temp)
  ld a, d
  call GetPixel
  ld h, a
  pop af
  ld a, h
  jr c, setPixel1

ResPixel1:
  cpl
  and (hl)
  ld (hl), a
  jr EndPlot1

SetPixel1:
  or (hl)
  ld (hl), a

EndPlot1:
  ld hl, (temp)
  ld de, (tx2)
  inc h
  ld (temp), hl
  ld b, h
  ld a, d
  cp b
  jp nc, QuadPlotLoop1

  ld hl, ty
  inc (hl)
  ld a, (y2)
  cp (hl)
  jp nc, QuadDrawLoop1

QuadDrawLoop2:
  ld hl, (tx1)
  ld de, (dx3)
  add hl, de
  ld (tx1), hl
  ld hl, (tu1)
  ld de, (du3)
  add hl, de
  ld (tu1), hl
  ld hl, (tv1)
  ld de, (dv3)
  add hl, de
  ld (tv1), hl
  ld hl, (tx2)
  ld de, (dx2)
  add hl, de
  ld (tx2), hl
  ld hl, (tu2)
  ld de, (du2)
  add hl, de
  ld (tu2), hl
  ld hl, (tv2)
  ld de, (dv2)
  add hl, de
  ld (tv2), hl

  ld hl, (tx1)
  ld (temp), hl      ;x = temp

QuadPlotLoop2:
  ld hl, (tx2)
  ld de, (tx1)
  subFP
  push hl
  ld hl, (temp)
  ld de, (tx1)
  subFP
  pop de
  call DivFP
  ld (temp2), hl   ;T = temp2
  ld hl, $0100
  ld de, (temp2)
  subFP
  ld bc, (tu1)
  call MulFP
  push de
  ld hl, (temp2)
  ld bc, (tu2)
  call MulFP
  pop hl
  add hl, de
  ld a, h
  ld (temp3), a      ;u = temp3
  ld hl, $0100
  ld de, (temp2)
  subFP
  ld bc, (tv1)
  call MulFP
  push de
  ld hl, (temp2)
  ld bc, (tv2)
  call MulFP
  pop hl
  add hl, de
  ld a, h
  ld (temp3+1), a      ;v = temp3+1
;Get the pixel at (u,v) from the texture
  ld   hl, (temp3+1)
  ld   h, 0

  ld   de, texture
  add   hl, de

  ld   a, (temp3)
  ld   b, a
  inc   b
  ld a, (hl)
shiftLoop2:
  rl   c
  djnz   shiftLoop2

  push af
  ld a, (ty)
  ld l, a
  ld de, (temp)
  ld a, d
  call GetPixel
  ld h, a
  pop af
  ld a, h
  jr c, setPixel2

ResPixel2:
  cpl
  and (hl)
  ld (hl), a
  jr EndPlot2

SetPixel2:
  or (hl)
  ld (hl), a

EndPlot2:
  ld hl, (temp)
  ld de, (tx2)
  inc h
  ld (temp), hl
  ld b, h
  ld a, d
  cp b
  jp nc, QuadPlotLoop2

  ld hl, ty
  inc (hl)
  ld a, (y3)
  cp (hl)
  jp nc, QuadDrawLoop2

QuadDrawLoop3:
  ld hl, (tx1)
  ld de, (dx3)
  add hl, de
  ld (tx1), hl
  ld hl, (tu1)
  ld de, (du3)
  add hl, de
  ld (tu1), hl
  ld hl, (tv1)
  ld de, (dv3)
  add hl, de
  ld (tv1), hl
  ld hl, (tx2)
  ld de, (dx4)
  add hl, de
  ld (tx2), hl
  ld hl, (tu2)
  ld de, (du4)
  add hl, de
  ld (tu2), hl
  ld hl, (tv2)
  ld de, (dv4)
  add hl, de
  ld (tv2), hl

  ld hl, (tx1)
  ld (temp), hl      ;x = temp

QuadPlotLoop3:
  ld hl, (tx2)
  ld de, (tx1)
  subFP
  push hl
  ld hl, (temp)
  ld de, (tx1)
  subFP
  pop de
  call DivFP
  ld (temp2), hl   ;T = temp2
  ld hl, $0100
  ld de, (temp2)
  subFP
  ld bc, (tu1)
  call MulFP
  push de
  ld hl, (temp2)
  ld bc, (tu2)
  call MulFP
  pop hl
  add hl, de
  ld a, h
  ld (temp3), a      ;u = temp3
  ld hl, $0100
  ld de, (temp2)
  subFP
  ld bc, (tv1)
  call MulFP
  push de
  ld hl, (temp2)
  ld bc, (tv2)
  call MulFP
  pop hl
  add hl, de
  ld a, h
  ld (temp3+1), a      ;v = temp3+1
;Get the pixel at (u,v) from the texture
  ld   hl, (temp3+1)
  ld   h, 0

  ld   de, texture
  add   hl, de

  ld   a, (temp3)
  ld   b, a
  inc   b
  ld a, (hl)
shiftLoop3:
  rl   c
  djnz   shiftLoop3

  push af
  ld a, (ty)
  ld l, a
  ld de, (temp)
  ld a, d
  call GetPixel
  ld h, a
  pop af
  ld a, h
  jr c, setPixel3

ResPixel3:
  cpl
  and (hl)
  ld (hl), a
  jr EndPlot3

SetPixel3:
  or (hl)
  ld (hl), a

EndPlot3:
  ld hl, (temp)
  ld de, (tx2)
  inc h
  ld (temp), hl
  ld b, h
  ld a, d
  cp b
  jp nc, QuadPlotLoop3

  ld hl, ty
  inc (hl)
  ld a, (y2)
  cp (hl)
  jp nc, QuadDrawLoop3

  ret



getPixel:
   ld   h, 0
   ld   d, h
   ld   e, l
   
   add   hl, hl
   add   hl, de
   add   hl, hl
   add   hl, hl
   
   ld   e, a
   srl   e
   srl   e
   srl   e
   add   hl, de
   
   ld   de, PlotSScreen
   add   hl, de
   
   and   7
   ld   b, a
   ld   a, $80
   ret   z
   
   rrca
   djnz   $-1
   ret

Generated by the BBCode Converter (http://clrhome.co.cc/resources/bbify/)

EDIT: the code is now syntax highlighted to make it more readable.

839
A little web project I've been working on: BBify
Could you please post it again? I only get a 403: Forbidden error.

840
Miscellaneous / Re: Do you work a job programming?
« on: July 28, 2011, 05:12:34 pm »
I am just programming as an hobby, and i don't think i'll ever get a job as a programmer. Right now I'm studying science and technology, so i'm also not in the right school to become a programmer.

Pages: 1 ... 54 55 [56] 57 58 ... 71