iova
November 21, 2014, 11:59am
1
Hello, I am trying to build an parallel view.
I used following frustum settings, to zoom out:
cam.setParallelProjection(true);
cam.setFrustum( 0, 20, -12, 12, -10, 10);
cam.update();
The result is, that I can see my scene only from below and the light is inverted. By the way my scene is not bigger than 10.
And Objects, that should be displayed are missing.
I believe, that someway the rendering is misplaced. Because when I place the camera in top of the objects, I can only see the rear side of the objects.
Maybe something with the size of the camera is wrong? I didn’t change it but used the build in camera from simpleApplication.
nehon
November 21, 2014, 12:19pm
2
Hard to say what’s wrong, but Maybe you can see how it’s done in TestParallelProjection
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
This file has been truncated. show original
pspeed
November 21, 2014, 4:07pm
3
What direction is the camera facing?
Instead of
cam.setFrustum( 0, 20, -12, 12, -10, 10);
use
cam.setFrustum( 0, 20, -12, 12, 10, -10);
iova
November 23, 2014, 12:15pm
5
Thank you! using
cam.setFrustum( 0, 20, -12, 12, 10, -10)
;
worked. Simply I didn’t see, that the last values were in the wrong way. Yes, first up than down.