I need to create a graph that bulges as you move over it.

Something like this after you press “1” on that page.

Only problem is, I’m not experienced enough at coding, nor do I know the math needed to implement something like this. I know that this isn’t exactly easy to do, so if someone offered me any help with this I’d gladly do an art for code exchange, but we can talk about that later.

The amount of bulge needs to be dependent on the mass of the object, and I also need to be able to set how dense the graph is.

Thanks in advance for any help.

Drifter

A simple solution would be to create a plane and move the vertices with the mesh class.
You can find an example of this here
Let me know exactly what you need and I will code it for, if it is not too much work.

Ok, this makes sense and should work fine. How would I set up the wireframe (the grid) so that you can visibly see all of the lines in the mesh?

texture, I suppose, if you go with a mesh. You would create the plane with a 3d modelling app with say 20x20 vertices and apply a grid texture on it that is again 20x20. Maybe with some transparency. Hopefully it would look ok.

This portion of your problem seems like a great match for vectrosity, which would be much more dynamic than a texture.

not something I really want to spend money on, but thanks.

But it’s really good, and exactly what you want for this sort of thing. :slight_smile:

–Eric

Says the man who wrote it :stuck_out_tongue:

No seriously though; this is a task that Vectrosity will greatly assist in accomplishing.

well, i’m going to try a very high res texture first, although I’m still not sure how to make the individual vertices move

EDIT: NVM I was wrong. :x

I’m 100% totally unbiased, I swear. :wink:

If you were using Vectrosity, you’d do something like this:

var gridSize = 50;
var gridMaterial : Material;
private var gridLine : VectorLine;
private var gridPoints : Vector2[];

function Start () {
	gridPoints = new Vector2[ (Screen.width/gridSize * 2) * (Screen.height/gridSize * 2) ];
	gridLine = new VectorLine("Grid", gridPoints, gridMaterial, 2.0);
	// routine for making a grid using gridPoints here
}

function Update () {
	// do cool math stuff with gridPoints here
	Vector.DrawLine(gridLine);
}

Now all you have to do is replace the commented lines with actual code. :wink: Making the grid would be a quite simple nested pair of for loops, the other part would no doubt involve Input.mousePosition and, um, some math.

–Eric

Yes, doing it properly would require vectrocity and some math :slight_smile:

But as a quick simple example, here it is with a mesh
gird example

622409–22153–$GridExample.zip (934 KB)