Author Topic: Brick terrain generation by simplex noise  (Read 976 times)

http://www.paulinternet.nl/?page=bicubic

oh god help meeeeeeeeeee


idk how to do it.
« Last Edit: July 24, 2012, 08:10:08 PM by Axolotl »


what is that
something that you will learn in years to come

wait, I think I might be able to solve my own suggestion.

I'm working on a cubic interpolation function.

Code: [Select]
function cubicInterpolate1D(%pa,%pb,%pc,%pd,%x)
{
%ax3 = (((-1/2) * %pa) + ((3/2) * %pb) + ((-3/2) * %pc) + ((1/2) * %pd)) * mPow(%x, 3) //generate ax3
%bx2 = (%pa + ((-5/2) * %pb) + (2 * %pc) + ((-1/2) * %pd)) * mPow(%x, 2); //generate bx2
%cx = ((-1/2) * %pa + (1/2) * %pc) * %x) //generate cx
return %ax3 + %bx2 + %cx + %pa
}
idk if this generates correct results.
« Last Edit: July 24, 2012, 06:07:41 PM by Axolotl »

wtf are you trying to do axolotl? this looks like rocket science to me

more like simplex noise

help me I goofed up on it hard

Code: [Select]
function cubicInterpolate1D(%pa,%pb,%pc,%pd,%x) //generate a cubic curve by Catmull-Rom spline
{
%ax3 = ((-0.5 * %pa) + (1.5 * %pb) + (-1.5 * %pc) + (0.5 * %pd)) * mPow(%x, 3); //generate ax3
%bx2 = (%pa + (-2.5 * %pb) + (2 * %pc) + (-0.5 * %pd)) * mPow(%x, 2); //generate bx2
%cx = ((-0.5 * %pa) + (0.5 * %pc) * %x); //generate cx
return %ax3 + %bx2 + %cx + %pa;
}

function serverCmdCreateCubicCurve(%cl,%pa,%pb,%pc,%pd,%scale)
{
for(%i = 0; %i <= %scale * 4; %i++)
{
%brick = new fxDTSBrick()
{
dataBlock = "brick4xCubeData";
position = 0 SPC %i * 2 SPC cubicInterpolate1D(%pa,%pb,%pc,%pd,%i / %scale);
stackBL_ID = %cl.bl_id;
};
echo(%brick);
%brick.plant();
}
}
more like simplex noise
what a brilliant idea, but you do it :c
« Last Edit: July 24, 2012, 08:13:05 PM by Axolotl »

can you even have datablock names as strings?

can you even have datablock names as strings?
Dumping a brick returns a stringed datablock

can you even have datablock names as strings?

...

you can have anything as a string

if there is an object with the ID 1000 and the name Donut

==>echo( isObject( "Donut" ) );
1
==>echo( isObject( "1000" ) );
1


and datablocks are just regular objects
you can even use setName on them

aaaghhhhh

I only know how to handle linear and quadratic! I'll leave this to Port, I think he has better education and is able to do something like this.

If he can't handle it, then we are doomed unless somebody else can.

...

you can have anything as a string

if there is an object with the ID 1000 and the name Donut

==>echo( isObject( "Donut" ) );
1
==>echo( isObject( "1000" ) );
1


and datablocks are just regular objects
you can even use setName on them
i was just wondering if torque would see "Brick4xCubeData" as a string instead of an object, but i guess it won't

i was just wondering if torque would see "Brick4xCubeData" as a string instead of an object, but i guess it won't
It won't, I've tried it.