X_SPRITE not working on gp2x

Previous topic - Next topic

XaMMaX

Is there a way get to work X_SPRITE on the gp2x? Models work fine, but X_SPRITE now drawing(
Sry for my english

Scott_AW

One alternative would be to create your own billboard, but you'd be create a model every loop.

Using the camera's vertical and horizontal angles with SIN and COS you can recreate a ortho sprite.

Not actually tested...
Code (glbasic) Select

  hang = //Camera horizontal angle
  vang = //Camera vertical angle
  width = 64
  height = 64
  hw = width/2
  hh = height/2
  x_s = COS(hang+90) * hw
  x_e = COS(hang+90) * -hw
  y_s = SIN(vang) * hh
  y_e = SIN(vang) * -hh
  z_s = COS(hang+180) * hw
  z_e = COS(hang+180) * -hw

  X_OBJSTART
    X_OBJADDVERTEX x_s, y_s, z_e, 0, 0, rgb(255,255,255)
    X_OBJADDVERTEX x_s, y_e, z_e, 0, 1, rgb(255,255,255)
    X_OBJADDVERTEX x_e, y_s, z_s, 1, 0, rgb(255,255,255)
    X_OBJADDVERTEX x_e, y_e, z_s, 1, 1, rgb(255,255,255)
  X_OBJEND


May need some tweaking, but that's the basic idea.  Although its unfortunate to hear the x_sprite doesn't work correctly, I've been using that in my recent project :(





Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/