From: Bruce S. <Bru...@nc...> - 2008-08-08 03:10:04
|
Here's a simple example of zooming in without changing the center: from visual import * scene.range = 5 sphere(pos=(-1,0,0), radius=0.5, color=color.red) box(pos=(1,0,0), color=color.cyan) scene.mouse.getclick() scene.range = 3 scene.mouse.getclick() scene.range = 1 I'm not sure I've seen the effect you're referring to about being near the center. Perhaps you should post a specific example. If you do, please strip it down to the simplest test case you can find that illustrates your point. Bruce Sherwood Roberto Aguirre Maturana wrote: > Hi, everybody: > > I am working on an application that uses VPython to navigate around > the spatial data in a way very similar to games like Quake (tm), so > you can fly around using a combination of keys w,a,s,d and changing > the forward direction with the mouse and left button (in a simmilar > way to stonegenhe.py). > > The problem is that the best results are obtained when > scene.mouse.camera is very close to scene.center. But when this > happens the rendering seems to fail, and objects look jagged and in > some cases you can see far objects that should be hidden behind closer > ones. > > Therefore, I have two questions: > > 1. Is there a way to solve the renderig problem on short camera-center > distances? > 2. Is there a code way to move the camera away form the center without > changing the center position itself (that is, emulate the dragging of > left+right button by code)? > > Many thanks in advance. > |