Hello,

Is there someway that I can randomly assign an x y and z axis to a geometirical object?

Any programming language is fine just need some insight.

Thank you,

Suhail Rawal

generate random numbers

sirlink99

What do you mean by that?

See the Math random() method and the Random class. Both will generate random numbers

yes but how does that help me generate random axis?

What values of x, y and z do you need?
Are those the only 3 numbers or are there more?
Where will you get those values from?

for example you can type

int x = Math.round (Math.random () * 100); // will generate a number between 0 and 100

Then you can use that x variable to print your square, cube, text, etc. on the screen at the generated value.

You can do the same for the y and the z axis.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.