Customize My Profile - Little Help Please

Y3LL0WM4GT

Leaf Village Regular 🍃
Regular
Joined
Oct 19, 2014
Messages
512
Reaction score
47
First off all can someone tell me what's the size for "Page Background" so it will cover whole page, tried to search for the size but didn't found anything. If you look at my profile the "Page Background" is at the top and the rest or more than half of the page is green ( -_-).

My last question is how do hell I do something like this, The Content above Visitor Messages.

You must be registered for see images


P.S Sorry for soo noobish questions but it's my first time when I'm customizing something in that damn vbulletin.
 

Vapid

Banned
Elite
Joined
Mar 12, 2014
Messages
5,249
Reaction score
470
Code:
struct DistanceTableEntry
{
	f32 t;
	f32 distance;
};

//The base Catmull-Rom evaluation function which requires 4 points
void CatmullRom_Evaluate(vec3* pOut_result, const vec3* p0, const vec3* p1, const vec3* p2, const vec3* p3, f32 t)
{
	const f32 c0 = ((-t + 2.0f) * t - 1.0f) * t * 0.5f;
	const f32 c1 = (((3.0f * t - 5.0f) * t) * t + 2.0f) * 0.5f;
	const f32 c2 = ((-3.0f * t + 4.0f) * t + 1.0f) * t * 0.5f;
	const f32 c3 = ((t - 1.0f) * t * t) * 0.5f;
	
	ScaleVec3(pOut_result, p0, c0);
	AddScaledVec3_Self(pOut_result, p1, c1);
	AddScaledVec3_Self(pOut_result, p2, c2);
	AddScaledVec3_Self(pOut_result, p3, c3);
}


//Evaluates a curve with any number of points using the Catmull-Rom method
void CatmullRom_EvaluateCurve(vec3* pOut_result, const vec3* pPoints, u32 numPoints, f32 t)
{
	const f32 index1F = t * (f32)(numPoints-1);
	const u32 index1 = (u32)index1F;
	
	const f32 remainder = index1F - (f32)index1;
	
	const u32 index0 = MaxS32(0,index1 - 1);
	const u32 index2 = index1 + 1;
	const u32 index3 = MinS32(numPoints-1,index1 + 2);
	
	const vec3* p0 = &pPoints[index0];
	const vec3* p1 = &pPoints[index1];
	const vec3* p2 = &pPoints[index2];
	const vec3* p3 = &pPoints[index3];
	
	CatmullRom_Evaluate(pOut_result, p0, p1, p2, p3, remainder);
}



//Creates the specified number of points along a Catmull-Rom spline (non-uniform)
void CatmullRom_CreatePoints(vec3* pOut_pointArray, u32 numPointsDesired, const vec3* pCurvePoints, u32 numCurvePoints)
{	
	const f32 numPointsDesiredMin1 = (f32)(numPointsDesired-1);
	
	for(u32 i=0; i<numPointsDesired; ++i)
	{
		const f32 t = (f32)i/numPointsDesiredMin1;
		CatmullRom_EvaluateCurve(&pOut_pointArray[i],pCurvePoints,numCurvePoints,t);
	}
}


//Creates the specified number of points along a Catmull-Rom spline (uniformly spaced)
void CatmullRom_CreatePoints_Uniform(vec3* pOut_pointArray, u32 numPointsDesired, const vec3* pCurvePoints, u32 numCurvePoints, DistanceTableEntry* pDistTable, u32 numDistTableEntries)
{
	const f32 numPointsDesiredMin1 = (f32)(numPointsDesired-1);
	const f32 totalLength = pDistTable[numDistTableEntries-1].distance;
	
	for(u32 i=0; i<numPointsDesired; ++i)
	{
		const f32 distT = (f32)i/(f32)numPointsDesiredMin1;
		const f32 distance = distT * totalLength;
		
		const f32 t = Curve_TValueFromDist(distance,pDistTable,numDistTableEntries);
		CatmullRom_EvaluateCurve(&pOut_pointArray[i],pCurvePoints,numCurvePoints,t);
	}
}


//Creates a distance table used by Curve_TValueFromDist below
void Curve_CreateDistanceTable(DistanceTableEntry* pOut_result, const vec3* pPoints, u32 numPoints)
{
	const u32 numPointsMin1 = numPoints-1;
	
	f32 distSoFar = 0.0f;
	
	pOut_result[0].distance = 0.0f;
	pOut_result[0].t = 0.0f;
	
	for(u32 i=1; i<numPoints; ++i)
	{
		const f32 dist = DistVec3(&pPoints[i-1], &pPoints[i]);
		
		distSoFar += dist;
		
		DistanceTableEntry* pEntry = &pOut_result[i];
		pEntry->distance = distSoFar;
		pEntry->t = (f32)i/(f32)numPointsMin1;
	}
}


//When evaluating a spline, pass in a dist (0 to max) to get a T value to pass in
f32 Curve_TValueFromDist(f32 dist, DistanceTableEntry* pDistTable, u32 numDistTableEntries)
{
	for(s32 i=numDistTableEntries-2; i != -1; --i)
	{
		DistanceTableEntry* pEntry = &pDistTable[i];
		if(dist >= pEntry->distance)
		{
			if(i == numDistTableEntries-1)
			{
				return 1.0f;
			}
			else
			{
				DistanceTableEntry* pNextEntry = &pDistTable[i+1];
				const f32 lerpT = (dist-pEntry->distance)/(pNextEntry->distance-pEntry->distance);
				const f32 t = Lerp(pEntry->t, pNextEntry->t, lerpT);
				
				return t;
			}
		}
	}
	
	return 0.0f;
}
Hope this helps. :)
 

Silico

Banned
Legendary
Joined
May 26, 2012
Messages
14,626
Reaction score
1,665
For one thing the main page bg is always 1003 pixels wide but it depends totally on how big your intro and other stuff(like pictures in vm's) amount of groups well anything that would tear your profile vertically outwards more. But something in the lines of 2500 pixels should do for plenty. Mine is 2335 vertically and i have a lot of shit on my profile.

Last question looks like a ps'd text.
 
Top