Voxel Venture, and a troll story...

Posted by Scott_AW on Sept. 9, 2010, 4:39 a.m.

Today my wife had her first real encounter with an internet troll…but I'll go on about that later.

Desertfox, you little voxel code is wonderfully commented. Although there's a few typos and a chunk of it is misplaced. It loads tmaxNs with tdeltaNs before the tdeltaNs are even setup.

But so far so good.

Still have a lot of work to do before I can see if it really works. After basic setup in GLBasic, I've converted about half the algorithm so far, and hopefully I'll get a little more done tonight.

I'll be plucking the voxel loading code from my image2voxel program so I can just pop in some data to test.

So if I can get this to move along smoothly I may be able to do the voxel RPG in GLBasic.

Mac Voxels, woo! However I still haven't figured out how to get things to work in linux yet.

Now, trolly talk.

While writing this my wife and her friend are talking about said troll, actually now they started talking about another real life troll…but I digress.

Story time.

So my wife has a friend with a son who recently left her no-good boyfriend to go live with her brother in the mid-west.

Ug, they're still describing her. OMG she said she wore spanx! xP

Anyway her brother happens to married to a real life troll. That's pretty much the best way to describe her.

The physical description will churn your stomach.

Lets say saggy milky calves with veins that look like they were drawn with marker. No chest, immense gut. Neck that flowed onto her chest. Spanx…shorts…bleg..

Anyway, if looks could describe they would. Apparently she has complete control over my wife's friend's brother. She turned everything around on her when she was supposed to help her get her Child aid and such. Resources that would allow her to do things like help with bills and rent?

Anyway my wife's friend and her son have flew the coup after they suggested that it would be best if they kept the kid.

So a bus ride later, they're chilling with us. Check the face book? Still friends with the troll?

Well, it apparently turned into a Troll vs. Ladies.

With the troll using the basics like stupid accusations that are actually their own intentions that they try to cast on you, along with barrage of cap's talk.

Suffice to say the ladies responded like adults, further angering said troll. Trolls do not like being called childish apparently.

There's more, so much more. But now is time to put that behind us, cuz you can block bitches on facebook.

I'm debating if it would be going too far to put the troll's profile on 4chan's hit list. Just saying.

Comments

Kaz 14 years, 2 months ago

Quote:
However I still haven't figured out how to get things to work in linux yet.
That's what I like about linux users. Most of the time they are the ones who have to try to make things work, not the developer =P

HeroofTime55 14 years, 2 months ago

"I'm debating if it would be going too far to put the troll's profile on 4chan's hit list. Just saying."

NYPA, newfag. .

DesertFox 14 years, 2 months ago

I look at my code I gave you, and I immediately think "Why the heck did I do that? That was stupid!"

You caught my error, but just to make sure you swapped things right, here's a corrected version, with edited bits in bold:

//This voxel raycast/pixel-traversal algorithm based on:
//	<a rel="nofollow" href="http://www.cse.yorku.ca/~amana/research/grid.pdf">http://www.cse.yorku.ca/~amana/research/grid.pdf</a>
//returns either the collision point, or null if no collisions within max_len pixel checks
function RaycastVoxel(Array voxels, Point origin, Point target,int max_len) returns Point
{	
	//XYZ Pixel start
	int X=floor(origin.X);
	int Y=floor(origin.Y);
	int Z=floor(origin.Z);
	
	//if you are casting from a filled pixel, STOP and return it
	if(voxels[X,Y,Z] is not empty)
		return new Point(X,Y,Z);
		
	//do we increase or decrease on step?
	float stepX = 1; if(origin.X > target.X) stepX = -1;
	float stepY = 1; if(origin.Y > target.Y) stepY = -1;
	float stepZ = 1; if(origin.Z > target.Z) stepZ = -1;
	
	//position along "ray" at each boundary
	float tMaxX = 0;
	float tMaxY = 0;
	float tMaxZ = 0;
	
	//set up initial position - basically "where is origin.X/Y/Z in the pixel?"
	if (stepX == 1)
		tMaxX = ceil(origin.X) - origin.X;
	else
		tMaxX = origin.X - floor(origin.X);
	if (stepY == 1)
		tMaxY = ceil(origin.Y) - origin.Y;
	else
		tMaxY = origin.Y - floor(origin.Y);
	if (stepZ == 1)
		tMaxZ = ceil(origin.Z) - origin.Z;
	else
		tMaxZ = origin.Z - floor(origin.Z);
		
	//origin-to-target length
	float tDelta=sqrt(
		(target.X-origin.X) * (target.X-origin.X)
		+ (target.Y-origin.Y) * (target.Y-origin.Y)
		+ (target.Z-origin.Z) * (target.Z-origin.Z)
		);

	//tDeltaN = tDelta/(target.N - origin.N);
	[b]tDeltaX = tDelta/abs(target.X - origin.X);
	tMaxX = tDeltaX * tMaxX;
	tDeltaY = tDelta/abs(target.Y - origin.Y);
	tMaxY = tDeltaY * tMaxY;
	tDeltaZ = tDelta/abs(target.Z - origin.Z);
	tMaxZ = tDeltaZ * tMaxZ;[/b]
	
	//if ray origin in right on boundary, assume its in the pixel
	//that is further/greater along that axis
	if(origin.X==X)//on X boundary between points
	{
		tMaxX = tDeltaX;
		if (stepX == -1)
			tMaxX = 0;
	}
	if(origin.Y==Y)//on Y boundary between points
	{
		tMaxY = tDeltaY;
		if (stepY == -1)
			tMaxY = 0;
	}
	if(origin.Z==Z)//on Z boundary between points
	{
		tMaxZ = tDeltaZ;
		if (stepZ == -1)
			tMaxZ = 0;
	}
	
	//unless (target.N - origin.N) is zero (DIVIDE BY ZERO ANYONE?)
	//in which case, tDeltaN = 0 and tMaxN = infinity (or 9999999 for numeric sake)
	
	[b]if(origin.X == target.X)//X/Y/Z delta is zero
	{
		tDeltaX=0;		
		tMaxX=999999;
	}
	if(origin.Y == target.Y)
	{
		tDeltaX=0;		
		tMaxX=999999;
	}
	if(origin.Z == target.Z)
	{
		tDeltaZ=0;	
		tMaxZ=999999;		
	}[/b]
	
	//traverse pixels, checking a maximum of max_len pixels
	for (int i = 0; i < max_len; i++)
	{
		if(tMaxX < tMaxY && tMaxX < tMaxZ) {
			tMaxX = tMaxX + tDeltaX;
			X = X + stepX;
		}
		else if (tMaxY < tMaxX && tMaxY < tMaxZ)
		{
			tMaxY = tMaxY + tDeltaY;
			Y = Y + stepY;
		}
		else
		{
			tMaxZ = tMaxZ + tDeltaZ;
			Z = Z + stepZ;
		}
		
		if (voxels[X,Y,Z] is not empty)
			return new Point(X,Y,Z);
	}
	return null;//no collision within max_len pixel checks	
}

Scott_AW 14 years, 2 months ago

LOL, I was wondering myself because the rest seemed fine.

Shame about linux, I want to like it but it just keeps being half-assed. Do I have to make my own Linux package or something?

Kaz 14 years, 2 months ago

It depends, is it a Java thing? Java might work.

Or is it C/C++? Don't know about that. I'll ask my friend who is a linux guru.

Ronnica 14 years, 2 months ago

Heheheheheh troll wears Spanx.

Scott_AW 14 years, 2 months ago

It uses SDL, I think I just need to get the proper drivers installed, but still annoying.

rufus 14 years, 2 months ago

nothing and i mean nothing is to petty to be put up on 4chan if its shit like that.