Quad HHelp

Blitz3D Forums/Blitz3D Programming/Quad HHelp

I want to keep a Quad working like a sprite in mode 4

how do i do this?

need help

So, basically face the camera, and rotate around the y axis. My method was to store only the quads vertex positions. The angle was just a variable and rotated ever time i updated them. You can also use tformpoint to do this. Sorry but my method was verrry confusing to do. I'm sure there code around the archives somewhere for this.

If not, post back, and i'll give you my stuff. :)

no joy :o(

this is wat i have

[code]
TFormPoint sx,sy,sz,0,camera
TFormVector -ss,-ss,0,camera,0
VertexCoords ssurf,s\verti[0],sx+TFormedX#(),sy+TFormedY#(),sz+TFormedZ#()
TFormVector ss,-ss,0,camera,0
VertexCoords ssurf,sverti[1],sx+TFormedX#(),sy+TFormedY#(),sz+TFormedZ#()
TFormVector -ss,ss,0,camera,0
VertexCoords ssurf,sverti[2],sx+TFormedX#(),sy+TFormedY#(),sz+TFormedZ#()
TFormVector ss,ss,0,camera,0
VertexCoords ssurf,sverti[3],sx+TFormedX#(),sy+TFormedY#(),sz+TFormedZ#()
[/code#

works as a normal sprite, but i need the billboard affect (mode 4 i think)


;sprite mode 1

pointentity quadsprite,camera
rotateentity quadsprite,0,entityyaw(quadsprite),0



;sprite mode 2

;lol just a standard quad




;sprite mode 3

pointentity quadsprite,camera




;Sprite mode 4

pointentity quadsprite,camera
rotateentity quadsprite,0,entityyaw(quadsprite),entityroll(camera)



Does this work?

I think he's using a single surface system so those methods dont apply.

im using single surface yupp

still having the problem tho

Neomancer, I'm not entirely sure how mode 4 sprites work (always face camera?) but my demo of 3D Points may contain some code to help you as it uses a single surface system with quads that always face the camera. It's here:

http://www.blitzbasic.com/codearcs/codearcs.php?code=1008#comments

It works by rotating the sprite on the y axis, to face the camera only. Good for rain particles and such :)

my single surface system does always face the camera, but it rolls as well, i want them to work like billboard or spectators

Well, the way i work it is, i simply hold info about each quad. Scale, rotation, etc etc.

Each time, i use the base value of scale=1 and the quad is unrotated. I rotate it everyframe to it's correct rotation, using sin and cos.

The way I do stuff like this is to have a scratchpad quad mesh which I copy the verts into, do the rotations (or whatever), then copy the verts back from the scratchpad to the single surface mesh.