Jump to content

  • Log In with Google      Sign In   
  • Create Account

WiredCat

Member Since 09 Apr 2011
Offline Last Active Today, 06:08 AM

Posts I've Made

In Topic: Plane equation, + or - D

21 May 2016 - 01:18 PM

lol

By this definition, the equation of a plane should be
Ax + By + Cz = D
 
Meaning a point is on the plane if it satisfies:
Ax + By + Cz - D = 0

In Topic: Render to screen buffer vs. to texture problem

28 April 2016 - 11:46 PM

Full source along with shaders would help anyone solve your problem.

In Topic: Billborad is not aligned to view

28 April 2016 - 07:22 AM

lol,

 

you are picking wrong matrix, and getting wrong vector,

 

 

how is

glGetFloatv(GL_PROJECTION_MATRIX, @Matrix);
Right:= Vectorize(Matrix[0,0], Matrix[0,1], Matrix[0,2]);
Up:=    Vectorize(Matrix[1,0], Matrix[1,1], Matrix[1,2]);

equal to

double m_PickInfo_ModelView[16];// of ;
 
  t3dpoint<float> Pos;
glGetDoublev(GL_MODELVIEW_MATRIX, m_PickInfo_ModelView);
 
BillboardX.x = m_PickInfo_ModelView[0];
BillboardX.y = m_PickInfo_ModelView[4];
BillboardX.z = m_PickInfo_ModelView[8];
 
 
BillboardY.x = m_PickInfo_ModelView[1];
BillboardY.y = m_PickInfo_ModelView[5];
BillboardY.z = m_PickInfo_ModelView[9];

to be more specific

glGetFloatv(GL_PROJECTION_MATRIX, @Matrix); and glGetDoublev(GL_MODELVIEW_MATRIX, m_PickInfo_ModelView);

 

 

 

after that you will have worldspace vectors (up, right) so you: LoadIdenity then setupcamera, and draw your object (defining position of billboard and its size)


In Topic: Billborad is not aligned to view

27 April 2016 - 06:42 AM

As far as i remember you need to get GL_MODELVIEW_MATRIX

 

then you get

 

BillboardX.x = mvm[0];
BillboardX.y = mvm[4];
BillboardX.z = mvm[8];
 
 
BillboardY.x = mvm[1];
BillboardY.y = mvm[5];
BillboardY.z = mvm[9];
 
those are yours worldspace up and right vectors
 
then

verts[i*4].v.x = particles[i].pos.x-BillboardX.x*particles[i].size+BillboardY.x*particles[i].size;
verts[i*4].v.y = particles[i].pos.y-BillboardX.y*particles[i].size+BillboardY.y*particles[i].size;
verts[i*4].v.z = particles[i].pos.z-BillboardX.z*particles[i].size+BillboardY.z*particles[i].size;
 
 
verts[i*4+1].v.x = particles[i].pos.x+BillboardX.x*particles[i].size+BillboardY.x*particles[i].size;
verts[i*4+1].v.y = particles[i].pos.y+BillboardX.y*particles[i].size+BillboardY.y*particles[i].size;
verts[i*4+1].v.z = particles[i].pos.z+BillboardX.z*particles[i].size+BillboardY.z*particles[i].size;
 
 
verts[i*4+2].v.x = particles[i].pos.x+BillboardX.x*particles[i].size-BillboardY.x*particles[i].size;
verts[i*4+2].v.y = particles[i].pos.y+BillboardX.y*particles[i].size-BillboardY.y*particles[i].size;
verts[i*4+2].v.z = particles[i].pos.z+BillboardX.z*particles[i].size-BillboardY.z*particles[i].size;
 
 
verts[i*4+3].v.x = particles[i].pos.x-BillboardX.x*particles[i].size-BillboardY.x*particles[i].size;
verts[i*4+3].v.y = particles[i].pos.y-BillboardX.y*particles[i].size-BillboardY.y*particles[i].size;
verts[i*4+3].v.z = particles[i].pos.z-BillboardX.z*particles[i].size-BillboardY.z*particles[i].size;

 

EDIT.

Yeah that was it:

 

 
void __fastcall  TFCOpenGL::drawbillboardF(float cx, float cy, float cz, float size)
{
double m_PickInfo_ModelView[16];// of ;
 
  t3dpoint<float> Pos;
glGetDoublev(GL_MODELVIEW_MATRIX, m_PickInfo_ModelView);
 
BillboardX.x = m_PickInfo_ModelView[0];
BillboardX.y = m_PickInfo_ModelView[4];
BillboardX.z = m_PickInfo_ModelView[8];
 
 
BillboardY.x = m_PickInfo_ModelView[1];
BillboardY.y = m_PickInfo_ModelView[5];
BillboardY.z = m_PickInfo_ModelView[9];
 
 
 
glBegin(GL_QUADS);
 
glTexCoord2f(0.0, 1.0);
 
Pos.x = cx-BillboardX.x*size+BillboardY.x*size;
Pos.y = cy-BillboardX.y*size+BillboardY.y*size;
Pos.z = cz-BillboardX.z*size+BillboardY.z*size;
 
glVertex3f(Pos.x,Pos.y,Pos.z);
glTexCoord2f(1.0, 1.0);
 
Pos.x = cx+BillboardX.x*size+BillboardY.x*size;
Pos.y = cy+BillboardX.y*size+BillboardY.y*size;
Pos.z = cz+BillboardX.z*size+BillboardY.z*size;
 
glVertex3f(Pos.x,Pos.y,Pos.z);
 
glTexCoord2f(1.0, 0.0);
Pos.x = cx+BillboardX.x*size-BillboardY.x*size;
Pos.y = cy+BillboardX.y*size-BillboardY.y*size;
Pos.z = cz+BillboardX.z*size-BillboardY.z*size;
glVertex3f(Pos.x,Pos.y,Pos.z);
 
glTexCoord2f(0.0, 0.0);
Pos.x = cx-BillboardX.x*size-BillboardY.x*size;
Pos.y = cy-BillboardX.y*size-BillboardY.y*size;
Pos.z = cz-BillboardX.z*size-BillboardY.z*size;
glVertex3f(Pos.x,Pos.y,Pos.z);
 
glEnd();
 
}

In Topic: How do I make Android apps with C++?

25 April 2016 - 02:04 AM

sites.google.com/site/customprog/ theres a menu on the left youll see setu eclipse for android theres complete guide.

 

You could use something else like rad studio which simply is click and run thing w/ any setup


PARTNERS