# wrapping my viewport around cylindrical projection surface

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all, I'm writing an app which has a very wide aspect ratio of 8:1 (3840x480). This will be projected onto the outside of a large (6m diameter) cylindrical projection surface (viewers will view from outside the cylinder). My scene is 3D with a fixed camera (pointing along Z as default). I have objects (very long snakelike physical objects made up of lots of springs) moving around in 3D. And I would like to give the illusion that the cylindrical projection surface is a real cylinder, with things moving inside it. My main problem is that of perspective. I think I need a vanishing point for every x position, i.e. a vanishing line (which runs horizontally down the middle of my viewport). Is this even possible to do? And if so how would I do it? I'm guessing its with glFrustum (usually I just use gluPerspective), but I'm not sure how to set it up! My second problem is that of wrapping the objects around when they cross the left or the right edge. I'm hoping that once the first problem is solved, this should just be a simple 2D check of object.x against my viewport boundaries and moving the object by screenWidth in 3D space. One other concern I have is how to deal with situations when half the object is on one side, and the other half on the other side - so I was thinking I could render the object twice if its near the edge (once normally, and once offset by screenWidth). Is there a better way to deal with this?

##### Share on other sites
glFrustum and gluPerspective setup a perspective matrix but the transformation is linear. If you draw 2 horizontal lines, they will always be parallel.

If you want to do some other type of effect, you will likely need to have some custom matrix or even more likely, you need to do the math in a vertex shader.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 10
• 9
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
633685
• Total Posts
3013317
×