pouët.net

Time to solve a hard math problem

category: general [glöplog]
fractional y? it says integer m on the page guybrush posted.
added on the 2007-09-24 21:06:09 by ryg ryg
OMG. Then the blobs will be even more boring than I thought. :-S
added on the 2007-09-24 21:30:33 by doomdoom doomdoom
forget shaders, just add more sugar and displace the mesh dynamicly and add some MFXish render-to-texture funk

BB Image

I should really sequence a demo together one day ...
Yeah right ! :)
added on the 2007-09-24 21:57:03 by TomS4wy3R TomS4wy3R
ryg: yay! Thanks for separating this out into the 2 1d problems. It's a big help to use the actual actual mesh points. There are very thin spikes in this formula. I'm going to try this tonight, but just to be a jerk, I'm going to crunch it in shader code as well (once per frame, obviously)

doom: the edges don't match up along the 2pi longitudinal line if you put in non integer m's. I do anyway. You can always just calc one half and mirror it. Also, Bourke is really clear about only plugging in +ve m's... I've played with -ves and the geometry goes 'open' which makes it not fit into anything.

skrebbel: Threads like these are for nerds! It's true about musicians (well, technical musicians anyway) making great demos. Buz made 'signal to droids' practically on his own, and it rocked.

to clear something up about shaders vs cpu - the geometry is being generated in the shader. The vertex buffer is static. That way it can distort and twist and whatever without me crunching the mesh in cpu, but that leads to the whole problem of figuring out how big everything will get, which is where we came in.

WY: sugar and funk is the plan :D
added on the 2007-09-24 22:01:40 by GbND GbND
gbnd: I meant the odd m's, ie. the powers. If they're non-integer you can't evaluate r to a real value across the whole sphere. But as I failed to notice, the odd m's are supposed to be integers anyway, so no problem.

The even m's, ie. coefficients for phi and theta, cause discontinuities on the surface when they're fractional because then you're not mapping whole (+half) periods of the sin and cos functions across the sphere. You can of course keep the mesh oriented so the seem is on the far side of the blob. If you add a constant to your phi and theta terms you can change the phase of the harmonics for more flexibility and to make up for the inability to freely rotate the mesh.

And now I also see why you wanted to scale the mesh before generating it. :) And for that, ryg's method is the best way to go, I think.

So there.
added on the 2007-09-24 22:50:22 by doomdoom doomdoom
if all m's are supposed to be integers, doesn't the equations reveal your fourier coefficients when expanded, which are supposed to be infinite for any shape involving squares?
infinite => infinitely many
anes: I don't restrict them to integers. The geometry matches up perfectly when you have them all as ints, but having one (minor) discontinuity at the 2pi longitude line is no big deal.

I haven't tried expanding out the fourier series for these - I'm just using the native sin/cos/pow functions in shader code, which map to native instructions (8 instruction slots for sin/cos, 3 for pow) in VS asm.

doom: Yeah. And that's what I do, is keep the camera on the side without the seam. Good idea about shifting the phase, I'll try that. I've also written code to push and pull geometry from points.
added on the 2007-09-24 23:59:36 by GbND GbND
gbnd: what is the limits in deviating from the original harmonics equations? i've posted a cube equation at the previous page, with less instructions, no pow.
in the above post, i of course didn't tell you to compute anything :)

when powers of cos and sine are positive integers, the whole expression is still cosines and sines with possibly higher harmonics of the original frequency. so both m's (even and odd) become restricted fourier series coefficients generators, with no possibility of finite m to generate infinitely many coefficients.

if all the m's are restricted to integers, it seems to me you need lots of them (well many lots) :) to generate min(abs(sec(theta)), abs(csc(theta))) , which is your equator, which is periodic, which then again means you can generate it with many lots of coefficients if there is a corresponding infinite m set.

if only odd m's are restricted to integers, and even m's are fractional, then you lose periodicity, and you don't have any finite or infinite set of odd m's. so a solution is not possible.

if m[5] or m[7] is fractional, say welcome to complex numbers flying around.

if m[1] or m[3] is fractional, it goes beyond this discussion, hehe :)

you could of course try negative integers for powers (secants baby!). m = { 1 -1 0 0 0 0 0 0 } at least maps to unit cube, for starters.

login