Quad HHelp

Blitz3D Forums/Blitz3D Programming/Quad HHelp

Neochrome(Posted 2004) [#1]
I want to keep a Quad working like a sprite in mode 4

how do i do this?


Neochrome(Posted 2004) [#2]
need help


Ross C(Posted 2004) [#3]
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. :)


Neochrome(Posted 2004) [#4]
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)


Isaac P(Posted 2004) [#5]

;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?


big10p(Posted 2004) [#6]
I think he's using a single surface system so those methods dont apply.


Neochrome(Posted 2004) [#7]
im using single surface yupp

still having the problem tho


big10p(Posted 2004) [#8]
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


Ross C(Posted 2004) [#9]
It works by rotating the sprite on the y axis, to face the camera only. Good for rain particles and such :)


Neochrome(Posted 2004) [#10]
my single surface system does always face the camera, but it rolls as well, i want them to work like billboard or spectators


Ross C(Posted 2004) [#11]
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.


big10p(Posted 2004) [#12]
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.