Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

AI thinks this is an ellipse

Name: Anonymous 2025-03-11 23:59

animpos = (1 - (VectorLength(v) / radius)) * (1 - (VectorLength(v) / (radius * aspect_ratio)));

... it isn't

Name: Anonymous 2025-03-12 0:00

Name: Anonymous 2025-03-12 2:32

AI thinks simply defining a minor axis and doing nothing with it, is enough.
(it's not)
https://zzzcode.ai/code-generator?id=20c15714-f524-4538-bd94-a046ea5e647a

# Ellipse Deformation Code

float numwaves = deform->parms[0] / deform->parms[1]; // Ellipse deformation
float semiMajorAxis = deform->parms[0]; // Ellipse deformation
float semiMinorAxis = deform->parms[1]; // Ellipse deformation
float exponent = deform->parms[2]; // Ellipse deformation
float *vert, *norm; // Ellipse deformation
// now deform vertexes // Ellipse deformation
for (j = 0; j < batchnumvertices; j++) // Ellipse deformation
{ // Ellipse deformation
vert = rsurface.batchvertex3f + 3*j; // Ellipse deformation
// deform vertex array to make water with elliptical waves // Ellipse deformation
VectorSubtract(center, vert, v); // Ellipse deformation
animpos = (semiMajorAxis - VectorLength(v)) / semiMajorAxis; // Ellipse deformation
animpos = max(0, animpos); // Ellipse deformation
if (animpos > 0) // Ellipse deformation
{ // Ellipse deformation
waveparms[0] = deform->waveparms[0]; // Ellipse deformation
waveparms[1] = deform->waveparms[1] * animpos; // Ellipse deformation
waveparms[2] = deform->waveparms[2] + pow(animpos, exponent) * numwaves; // Ellipse deformation
waveparms[3] = deform->waveparms[3]; // Ellipse deformation
scale = R_EvaluateQ3WaveFunc(deform->wavefunc, waveparms); // Ellipse deformation
norm = rsurface.batchnormal3f + 3*j; // Ellipse deformation
VectorMA(vert, scale, norm, vert); // Ellipse deformation
} // Ellipse deformation
}

Name: Anonymous 2025-03-12 2:40

The AI failed again:

float numwaves = deform->parms[0] / deform->parms[1]; // Au 15 roundwave
float radius = deform->parms[0]; // Au 15 roundwave
float exponent = deform->parms[2]; // Au 15 roundwave
float *vert, *norm; // Au 15 roundwave
float minor_radius = radius / 2;
// now deform vertexes // Au 15 roundwave
for (j = 0;j < batchnumvertices;j++) // Au 15 roundwave
{ // Au 15 roundwave
vert = rsurface.batchvertex3f + 3*j; // Au 15 roundwave
// deform vertex array to make water with round waves // Au 15 roundwave
VectorSubtract(center, vert, v); // Au 15 roundwave
animpos = (radius - VectorLength(v)) / radius; // Au 15 roundwave
animpos = max(0, animpos); // Au 15 roundwave
if (animpos > 0) // Au 15 roundwave
{ // Au 15 roundwave
waveparms[0] = deform->waveparms[0]; // Au 15 roundwave
waveparms[1] = deform->waveparms[1] * animpos; // Au 15 roundwave
waveparms[2] = deform->waveparms[2] + pow(animpos, exponent) * numwaves; // Au 15 roundwave
waveparms[3] = deform->waveparms[3]; // Au 15 roundwave
scale = R_EvaluateQ3WaveFunc(deform->wavefunc, waveparms); // Au 15 roundwave
norm = rsurface.batchnormal3f + 3*j; // Au 15 roundwave
//VectorMA(vert, scale, norm, vert); // Au 15 roundwave
VectorMA(vert, scale * (1 + (minor_radius / radius) * cos(vert[0])), norm, vert);
} // Au 15 roundwave
// Au 15 roundwave
}

https://zzzcode.ai/code-generator?id=7907d2ef-a560-4f09-9c12-854571483c90

Name: Anonymous 2025-03-12 2:43

animpos = (radius - VectorLength(v)) / radius * (1 - (VectorLength(v) / (radius / 2)));

Again this is a fail

Name: Anonymous 2025-03-12 2:47

nope.... waveparms[1] = deform->waveparms[1] * (radius - VectorLength(v)) / radius * (1 - (VectorLength(v) / (radius / 2))); // Au 15 roundwave

Name: Anonymous 2025-03-12 2:50

waveparms[0] = deform->waveparms[0]; // Au 15 roundwave
waveparms[1] = deform->waveparms[1] * (radius - VectorLength(v)) / radius * (1 - (VectorLength(v) / (radius / 2))); // Au 15 roundwave
waveparms[2] = deform->waveparms[2] + pow((radius - VectorLength(v)) / radius * (1 - (VectorLength(v) / (radius / 2))), exponent) * numwaves; // Au 15 roundwave
waveparms[3] = deform->waveparms[3]; // Au 15 roundwave
scale = R_EvaluateQ3WaveFunc(deform->wavefunc, waveparms); // Au 15 roundwave


kinda like an undeven buldge and undulation, .... might be useful

Name: Vecna, God of secrets 2025-05-31 6:09

Try (x,y) = (a*cos(t), b*sin(t))

If you want diagonal just multiply it by [cos(phi), sin(phi); -sin(phi), cos(phi)].

Then, if you want a different center, just sum (x0, y0) afterwards.

Name: Anonymous 2025-06-28 6:01

>>8
Giving the general formulae is not helpful in this instance.

The AI was told:
1) This code produces a circular wavefront
2) Modify it to produce an elliptical wavefront with 2 foci.

It was unable to do so.
I did, myself, find some algorithims that work for this through trial and error.
(2 foci, arbirary spot if desired for each, complementary spot if only 1 foci is written)
(both "tight" elipses, and "loose" elipse)
And some other algos that look nice, so they've all been added.

So I have a working solution in the C code.
However if you'd like to suggest another, using said C code that's been posted, feel free.
If it looks different than the solutions I came up with I'll add it as another type one can select.
(Note: this is a GPL'd opensource project (Quake engine))

Name: Anonymous 2025-06-28 6:11

>>8
Thanks for the math tip.
BTW: if you have other ideas for other shapes feel free to post it.
It might work with this code.

As the original code makes a circle of waves eminating outward.
One can use other algos to change the circle to something else if clever enough.
(5 pointed stars for instance maybe, various polygons). I think these terms would have to interact with the radius spot in the code.

Don't change these.
Name: Email:
Entire Thread Thread List