Comments (6)
Looks like a feature, not a bug: You're using ShowBase
. Have you tried base.setAspectRatio(ar)
instead of manipulating the Lens directly?
Sets the global aspect ratio of the main window. Set it to None to restore automatic scaling.
I'm not sure what you'd like to do: Set the aspect ratio of the camera out of sync from the window aspect ratio? You can also remove the window-event
that is being created by ShowBase
and implement your own instead. https://github.com/panda3d/panda3d/blob/4c2581a4d2831eb220ab03757051dc2b372bead9/direct/src/showbase/ShowBase.py#L579C1-L579C1
from panda3d.
I'll note that this behaviour doesn't seem to appear for me, under Ubuntu Linux (specifically, 18.04.6); it may thus be Mac-specific. (Presuming that it doesn't appear under Windows, of course.)
from panda3d.
@kamgha What I'm trying to do is represent a real camera and do some calculations. When the FOV changes, it changes my calculations. I want the window to be an exact representation of what the camera should see.
from panda3d.
@ArsThaumaturgis Thanks for trying it on Ubuntu Linux. I'm planning to try it on windows to see if it is just a macOS problem. I'll update about this.
from panda3d.
Normally ShowBase automatically adjusts the aspect ratio on any window-event, which includes window resizing but evidently also ⌘ + Tab.
To disable the default aspect ratio adjustment:
self.setAspectRatio(self.getAspectRatio())
Or maybe:
def adjustWindowAspectRatio(self, aspectRatio):
pass
from panda3d.
Hi @asmsulaiman , I find your report confusing. You have now renamed it and silently altered the initial description and your code sample! You were mentioning aspect ratio at first, now you mention FOV only. I've augmented your code with the scenery from the tutorial, to see it in action:
self.scene = self.loader.loadModel("models/environment")
self.scene.reparentTo(self.render)
self.scene.setScale(0.25, 0.25, 0.25)
self.scene.setPos(-8, 42, 0)
On Windows, there is no visible change in FOV. Something can be observed in macOS with your code, but this is due to the window-event
from ShowBase
being triggered around the creation of the window on Windows (but later on macOS).
It looks like your calculation is wrong: Change to w=32
in your new/current code sample to match to the default window-size of 800x600.
from panda3d.
Related Issues (20)
- Add support for system-provided gestures HOT 1
- add the possibility to record and replay InputDevice data (axes and buttons) HOT 2
- Add method for querying current display mode HOT 2
- Add support for Adaptive VSync HOT 1
- RawInputDevice gets added, although it probably shouldn't HOT 2
- MeshDrawer: "LinkSegment" Produces Unexpected UV-Mapping HOT 2
- Adding a second MouseRecorder fails HOT 4
- Bullet: Various class lifetime and mutex issues with set_contact_added_callback HOT 3
- Mesh Shader Support HOT 2
- can someone help me build debug version panda? HOT 8
- FLAC Decoder Wildly Out Of Date HOT 2
- small typo in inputDeviceNode.cxx
- PStats stops collecting data (after frame 1?) when pstats-python-profiler is active HOT 2
- bind_thread cannot be used on win32 debug (asserts enabled) code HOT 1
- Inconsistent compute shader behavior HOT 8
- Have Texture Adjustments to TextureStage.getDefault() be Reflected in the Texture Matrix HOT 2
- Wayland support HOT 1
- [gcc 13.2.1][manjaro][Debug] Panda Build failed: control reaches end of non-void function [-Werror=return-type] HOT 4
- Feature Suggestion: Ability to add custom entry handlers when loading egg files HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panda3d.