MikeHart
Administrator
- Joined
- Jun 19, 2017
- Messages
- 3,597
Hi folks,
as @SimonVD asked about if 2D in 3D is possible in CX, I gave it a try in mojo2.
With the help of some math stuff borrowed from miniB3D and Vortex2, you can set the ModelMatrix in a way that you can use the 3 dimensions.
Of course you need to tell mojo2 render in a perspective view instead an orthographic view and set the view matrix (your camera) in 3D Space.
Attached is the sample code. It is very slow on Android, but works great on Desktop and HTML5. Also depth-sorting needs to be done by yourself, means you need to draw from the back to the front. And please don't mind the programmers art.
Cheers
Michael
as @SimonVD asked about if 2D in 3D is possible in CX, I gave it a try in mojo2.
With the help of some math stuff borrowed from miniB3D and Vortex2, you can set the ModelMatrix in a way that you can use the 3 dimensions.
Of course you need to tell mojo2 render in a perspective view instead an orthographic view and set the view matrix (your camera) in 3D Space.
Attached is the sample code. It is very slow on Android, but works great on Desktop and HTML5. Also depth-sorting needs to be done by yourself, means you need to draw from the back to the front. And please don't mind the programmers art.
Cheers
Michael