How do I do simple 3D? (the cube is done already, see demo)

Get help using Construct 2

Post » Sun May 24, 2015 12:05 pm

Hello, dear Construct2 experts!
I've just made simple pseudo-3d example (the idea was found on a forum, thank you!).
Here is the DEMO: http://arte-code.com/3dT/index.html

I want to know is it possible to rotate and scale "vertical" lines of that cube with single function, regardless of line's count? I want to make a complex structure that way and don't want to make event changes manually.

I am attaching a .capx to my question: http://arte-code.com/3dT/top3d_lines.capx
B
9
S
2
G
1
Posts: 36
Reputation: 712

Post » Mon May 25, 2015 11:24 am

Well, I'll consider that silence as a proof that there are no shortcuts in the gamedev ^_^
B
9
S
2
G
1
Posts: 36
Reputation: 712

Post » Mon May 25, 2015 8:07 pm

Sure there is, it's called math.

The normal way to manipulate 3d points is to just change around the x, y, and z values to transform them. Then you use a perspective transform to map them to the screen.

You can read about vectors and matrices for the nitty gritty of the math.

To move you can just add numbers to the position to move them.
To rotate look up 2d rotation for a formula to do it.
Scaling is just a matter of multiplying the position by some values.

For rotation and scaling it's always done around the center 0,0,0. To do it around some other point you need to first move everything over so the rotation point is 0 then after that move the points back be the same amount.

Perspective in it's basic form is just dividing the x and y by the z.

You can look around the forum for a few examples. Search for "pseudo 3d" with my username for some various examples. There's also some examples in the tutorials.
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

Post » Tue May 26, 2015 4:46 am

Thank you, R0J0hound! You're an awesome man! Almost every mathematician is an awesome man, as I think ^_^
I found your examples and I'm looking in awe at them, they're giving me shivers actually.
But I can't count them as shortcuts, they're full-featured math problems (as for me). Nevertheless, thank you so much for your sole existence and will to help such dark creatures like myself ^_^
B
9
S
2
G
1
Posts: 36
Reputation: 712


Return to How do I....?

Who is online

Users browsing this forum: JackTYGA and 25 guests