Jump to content

  • Log In with Google      Sign In   
  • Create Account

ankhd

Member Since 05 Nov 2006
Offline Last Active Today, 04:38 AM

Topics I've Started

So Would you dress like a deer in hunting season

Yesterday, 06:12 PM

So why dress like zombies on Zombie hunting night.

 

Imagine if you were at the pub and walking home and a bunch of zombies started walking around would you blame the guy for picking up a stick and start smashing heads. could be a heap of people on bath salts (zombie drug). So you either smash them or have your face eaten off.


How do you tell if you apps being hooked by a third party terrorist

24 October 2014 - 06:29 PM

Hi. How could someone find out is someone is hooking you app.


How Does D3D10_APPEND_ALIGNED_ELEMENT Work

24 October 2014 - 05:54 AM

Hello All.

I was playing around with my input element discription and I thought I would use D3D10_APPEND_ALIGNED_ELEMENT, But if I use this my app crashes in strange places.

 

I normaly do this


//this is for my old vertex skinning witch we are using now
const D3D10_INPUT_ELEMENT_DESC VertexBlendVertex::VertexBlendLayout[5] =
{
  	   
	{ "POSITION",	0, DXGI_FORMAT_R32G32B32_FLOAT,			0,		0,  D3D10_INPUT_PER_VERTEX_DATA,		0 },
        { "WEIGHTS",	0, DXGI_FORMAT_R32G32B32A32_FLOAT,		0,		12, D3D10_INPUT_PER_VERTEX_DATA,	0 },
        { "BONES",	0, DXGI_FORMAT_R32G32B32A32_UINT,		0,              28, D3D10_INPUT_PER_VERTEX_DATA,	0 },
        { "NORMAL",	0, DXGI_FORMAT_R32G32B32_FLOAT,		        0,              44, D3D10_INPUT_PER_VERTEX_DATA,	0 },
        { "TEXCOORD",	0, DXGI_FORMAT_R32G32_FLOAT,			0,              56, D3D10_INPUT_PER_VERTEX_DATA,	0 },

};




But if I do this it crashes in random locations

const D3D10_INPUT_ELEMENT_DESC VertexBlendVertex::VertexBlendLayout[5] =
  {
	{ "POSITION",	0, DXGI_FORMAT_R32G32B32_FLOAT,			0,	0,                            D3D10_INPUT_PER_VERTEX_DATA,		0 },
        { "WEIGHTS",	0, DXGI_FORMAT_R32G32B32A32_FLOAT,		0,	D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA,	0 },
        { "BONES",	0, DXGI_FORMAT_R32G32B32A32_UINT,		0,      D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA,	0 },
        { "NORMAL",	0, DXGI_FORMAT_R32G32B32_FLOAT,			0,      D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA,	0 },
        { "TEXCOORD",	0, DXGI_FORMAT_R32G32_FLOAT,			0,      D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA,	0 },
 
 };

Heap Error

21 October 2014 - 10:54 PM

Hi all.

 

Whats does this here mean.

HEAP[RTSTowers.exe]: HEAP: Free Heap block 7155000 modified at 716af78 after it was freed
Windows has triggered a breakpoint in RTSTowers.exe.

This may be due to a corruption of the heap, which indicates a bug in RTSTowers.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while RTSTowers.exe has focus.

The output window may have more diagnostic information.
The program '[2432] RTSTowers.exe: Native' has exited with code 0 (0x0).

Does it mean Ive hit the limit of the stack Or is it I'm deleting and using it again.

 

How would I find Delete and using again this its saying. Because I dont delete any thing at init time only with classes on the stack that call there destructores and they all use std::vectors

 

But first I need to know what the error realy means Thanks.

 

 

 

 


Trying To Plot Points Around A Disk From Direction Vector.

12 October 2014 - 08:59 PM

Hi All.

I'm trying to create a particle thruster effect. What I'm thinking of doing is to spawn a ring of particles at the starting location
from a 3d direction vector, Where the ring of points are all perpenicular to the Direction vector. Once I have this ring of points I
will create a vector from the centre and give it length to form a apex where all points on the ring move towards.

here is a image of what I'm doing.

 

 

disk1.jpg?psid=1

 

I found some steps which is as follows,
//1. Choose any point P randomly which doesn't lie on the line through P1 and P2
//2. Calculate the vector R as the cross product between the vectors P - P1 and P2 - P1. This vector R is now perpendicular to P2 - P1. (If R is 0 then 1. wasn't satisfied)
//3. Calculate the vector S as the cross product between the vectors R and P2 - P1. This vector S is now perpendicular to both R and the P2 - P1.
//4. The unit vectors ||R|| and ||S|| are two orthonormal vectors in the plane perpendicular to P2 - P1.

I tryed following the above but when I set a minus Direction like so d3dvector3(0.0, -1.0, 0.0) or (-1,0,0) My particles dont render, I'm wondering
if I have the math wrong here is what Im doing.



float3 plane[3]; 

float3 n,p,r,s,p1p2; 

//the starting point
float3 p1 = gEmitPosW.xyz;

//apex location
float3 p2 = dir * 1900.0;//add some length to the direction



//p.x = rand(); /* Create a random vector */ 
//p.y = rand(); 
//p.z = rand(); 

//now creating a perp vector
randompoint = normalize(Perpendicular(p1p2));
r = randompoint;


s =  normalize(cross(p1p2, r));

  dtheta = 36.0;
  float th =0.0;

  for(theta=0;theta<360;theta+=dtheta) 
  { 
  th = radians(theta);
		 n.x = (r.x) * cos(th) + (s.x) * sin(th); 
		 n.y = (r.y) * cos(th) + (s.y) * sin(th); 
		 n.z = (r.z) * cos(th) + (s.z) * sin(th); 
		 normalize(n); 
		
		 //set the particl up

			////////////////////////////////////////////
			
			Particle p;
			p.initialPosW   = p1 + n* radius;
			p.initialVelW	= gEmitDirW.xyz;
			
			p.pDirW		  =	normalize(p2 - p.initialPosW );//p.initialVelW;
			p.sizeW       = float2(gParticleWidth, gParticleHeight);
			p.age         = 0.0f;//vRandom.x;
			p.type        = PT_FLARE;
			p.arrayid     = 0;
			p.initialVelW.x =  gFlashspeed;

				
			//add new particle
			ptStream.Append(p);
			

	}

Is there some thing wrong in the above code.

If I change the start and end points I can get it to render in the minus directions, but how do I do it when the direction can be unknown at the time.

 

 

I tryed doing this but it does nothing

//dir

if(length(p2) - length(p1)< 0)

p1p2 =dir;//p2 - p1;

else

p1p2 =normalize(p1 - p2);

 

 

This one has a up direction d3dvector3(0,1,0).

Don't worry about the bit comming out the buttom thats just my flame thrower particle.

 

Thruster.jpg?psid=1


PARTNERS