# mast4as

Member

7

124 Neutral

• Rank
Newbie
1. ## How does the pipeline generate pixels from vertices?

I think this is the information you are looking for: http://scratchapixel.com/lessons/3d-advanced-lessons/perspective-and-orthographic-projection-matrix/ and http://scratchapixel.com/lessons/3d-basic-lessons/lesson-6-rays-cameras-and-images/standard-coordinate-systems/
2. ## mesh versus entity in frustum

However when I was saying "breaking it up into chances" you can do this in the engine at render time. You can insert the polygons in the cells of your mesh (insert polygon only once) and then display the content of the cell in the cell boundaries (min and max) are contained in the frustum. This way, you don't need to go back to modeling and you can just use a simple grid as a start to do that. It might use a bit of memory and it will take some time to construct the grid (and find optimal settings for the size of the grid, etc.) but it might be simple and fun implementing the technique and see what you gain out of it.
3. ## Help needed setting up camera transform

Kevin by talking to the guys today I realised I made a mistake in my explanation. I amended the post above. Sorry about that. Please, if you find the time go through it again. You say you use column-major rather than row-major. The explanation I gave works for row-major so technically you will need to transpose the matrix. If other words for column major your matrix should be written with the basis vectors vertically:    |Rx Ux Fx| M =|Ry Uy Fy| if you use column-major    |Rz Uz Fz| Them matrix mult should be written as         |Rx Ux Fx|   |Vx| M * V = |Ry Uy Fy| * |Vy|         |Rz Uz Fz|   |Vz| For the right- left-hand naming convention I would also have a look at this page: http://scratchapixel.com/lessons/3d-basic-lessons/lesson-4-geometry/math-operations-on-points-and-vectors/ Now from my understanding, there's a lot of people out there using different names for the same thing which is very confusing. That's why I like to refer to this page and try to stick to their convention which seems to be following some of the industry standards. Hopefully what's in their website is accurate and reliable ;-)
4. ## mesh versus entity in frustum

If you mesh is only one big chunk you can break it using some of sort of spatial subdivision scheme a little bit like what the REYES algorithm does (it's not exactly the same but you can get inspire by the concept).
5. ## mesh versus entity in frustum

Are you talking about whether drawing your mesh if it's contained in the frustum (or straddling it). Generally checking if the object's bounding box is completely outside the frustum is already a good start and will certainly provide some level of optimisation. You might gain little from implementing a more complex intersection routine than that. However it all depends of the complexity of the geometry contained in the bbox. For instance if you render a terrain, a large part of the terrain might be outside the frustum but if it's part of a single mesh then you don't have a choice to discard the invisible bits. You need to be sure for large meshes that they are split into smaller bits (of reasonable size) organised eventually as a hierarchy, and then you can easily discard the individual pieces which are outside the frustum. If you choose this strategy, a lot of the objects will be culled and the drawing objects straddling on the frustrum's boundaries is probably okay...
6. ## Ray-AABB collision detection

You can find some information about the ray-box algorithm at this location:   http://scratchapixel.com/lessons/3d-basic-lessons/lesson-7-intersecting-simple-shapes/ray-box-intersection/   As mentioned by other people, don't print stuff out from your program. It will significantly slow things down (printf, std::cout <<, etc.).   To accelerate your code if you really need speed up you can use SSE instructions.