Ok guys,
I'm using Irrlicht inside a program which (at some point) needs to do some printing.
Not regular printing, but printing on a A1/A0, which has enormous resolutions.
Back when we had only software rendering we just divided the area that needed to be printed into managable tiles (e.g. 200x200 px), starting from left-top working towards right-down.
Ok, same principal applies to a 3d render printing process. I need to divide the frustrum into smaller frustrums (tiles) and render them each seperately.
However, a problem creeps up: now each tile has its own projection, which differs from all the other ones. (and I end up with what looks like how flies see, since each eye of the fly has its own lens (i.e. projection))
I need to have the (sub)camera's (one for each tile) at different positions, yet have the same (shared) projection.
Anyone understands the problem?
Anyone knows a solution?
Rendering to 60000x60000
Re: Rendering to 60000x60000
Most people assumes frustum view to be a cutted pyramid in wich there is a centra axis and the same angle between each plane and the axis. That's not totally true. OpenGL and I think also DirectX allows to specify arbitrary planes. (in OpenGL you can also specify directly the coordinates of each vertex of the frustum view).
Generally speaking FAR_PLANE and NEAR_PLANE are not parallel. So they can intersects themselves into a line (in standard geometry problems two planes wich are not parallel will always intersects at least in a line).
You must use a ViewMatrix/ProjectionMatrix in irrlicht for doing that, since that's the only way in the API for doing that.
Using a different matrix for each tile allows you to create a series of tileable frustum views. (actually your frustum views are not tiled, but are just a series of cutted piramids placed each one next to the others.)
The most simple way is to use a identity matrix (as irrlicht's GUI is doing). wich makes the viewing volume become a cube wich is strecthed on one side to fit the screen of your PC. the bad thing in this is that you lose your perspective projection and you gain a orthogonal projection scene. If you still need perspective you'd better find some tutorial on how to create a matrix, or you can just hack a bit irrlicht and use the easy-to-use OpenGL function for that.
Irrlicht API helps you a lot:
You can specify manually all 6 the planes in the SViewFrustum class, then use the class for build the matrices you need. And of course you can use the vertices of your ideal frustum view to build first the planes you need using the irrlicht's planes class. That's not as inputing directly the 8 vertices but is easy enough to do also without a deep matrix knowledge.
There are also methods in the matrix class for that.
Generally speaking FAR_PLANE and NEAR_PLANE are not parallel. So they can intersects themselves into a line (in standard geometry problems two planes wich are not parallel will always intersects at least in a line).
You must use a ViewMatrix/ProjectionMatrix in irrlicht for doing that, since that's the only way in the API for doing that.
Code: Select all
driver->setTransforms(ETS_VIEW, viewmatrix);
etc...
The most simple way is to use a identity matrix (as irrlicht's GUI is doing). wich makes the viewing volume become a cube wich is strecthed on one side to fit the screen of your PC. the bad thing in this is that you lose your perspective projection and you gain a orthogonal projection scene. If you still need perspective you'd better find some tutorial on how to create a matrix, or you can just hack a bit irrlicht and use the easy-to-use OpenGL function for that.
Irrlicht API helps you a lot:
You can specify manually all 6 the planes in the SViewFrustum class, then use the class for build the matrices you need. And of course you can use the vertices of your ideal frustum view to build first the planes you need using the irrlicht's planes class. That's not as inputing directly the 8 vertices but is easy enough to do also without a deep matrix knowledge.
There are also methods in the matrix class for that.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Re: Rendering to 60000x60000
Use an orthographic camera, that way there is no prespective shift for diffrent tiles
"Irrlicht is obese"
If you want modern rendering techniques learn how to make them or go to the engine next door =p
If you want modern rendering techniques learn how to make them or go to the engine next door =p
Re: Rendering to 60000x60000
REDDemon wrote: The most simple way is to use a identity matrix (as irrlicht's GUI is doing). wich makes the viewing volume become a cube wich is strecthed on one side to fit the screen of your PC..
wich is exactly the same thing ^^omaremad wrote: Use an orthographic camera, that way there is no prespective shift for diffrent tiles
Re: Rendering to 60000x60000
try using a vertex shader which enlarges and translates (moves) every object in the scene so the window/patch sits over the right part
Or learn to use a projection matrix (premult a translation and scale matrix with the projection matrix)
60000/200=300
scaleX and Y == 300
then translate according to which patch
Or learn to use a projection matrix (premult a translation and scale matrix with the projection matrix)
60000/200=300
scaleX and Y == 300
then translate according to which patch