Jo-Jo Posted December 6, 2007 Report Share Posted December 6, 2007 So I've been working with the OpenGL stuff for about a year or so on and off, and I have become pretty proficient. There is one thing that I can't seem to figure out, however. I have been trying to control the camera using the setup camera method, and I can't figure out what the up direction is. I thought it described a (unit) vector that pointed out of the top of the camera, but I'm certain that this is not the case, although it seems to be the case sometimes, however in some positions the camera inverts itself. The help files on this method are not useful, which is pretty much the case for most of the OpenGL stuff, unfortunately. Does anyone know how to use this method? ~Jo-Jo Quote Link to comment
JDave Posted December 6, 2007 Report Share Posted December 6, 2007 QUOTE(Jo-Jo @ Dec 5 2007, 02:53 PM) So I've been working with the OpenGL stuff for about a year or so on and off, and I have become pretty proficient. There is one thing that I can't seem to figure out, however. I have been trying to control the camera using the setup camera method, and I can't figure out what the up direction is. I thought it described a (unit) vector that pointed out of the top of the camera, but I'm certain that this is not the case, although it seems to be the case sometimes, however in some positions the camera inverts itself. The help files on this method are not useful, which is pretty much the case for most of the OpenGL stuff, unfortunately. Does anyone know how to use this method?~Jo-Jo Are you programming in LabVIEW? If not, you may be in the wrong place. There is a toolkit for LabVIEW called OpenG that may have accidentally pointed you here. Quote Link to comment
Jo-Jo Posted December 6, 2007 Author Report Share Posted December 6, 2007 QUOTE(JDave @ Dec 5 2007, 11:13 PM) Are you programming in LabVIEW? If not, you may be in the wrong place. There is a toolkit for LabVIEW called OpenG that may have accidentally pointed you here. Yes, I'm programming in LabVIEW. The setup camera method is a method of the 3D picture indicator. Quote Link to comment
JDave Posted December 6, 2007 Report Share Posted December 6, 2007 QUOTE(Jo-Jo @ Dec 5 2007, 03:34 PM) Yes, I'm programming in LabVIEW. The setup camera method is a method of the 3D picture indicator. Sorry. I didn't recognize what you were referring to. And I haven't used the 3D picture yet, so hopefully someone else will be able to help out. David Quote Link to comment
LAVA 1.0 Content Posted December 7, 2007 Report Share Posted December 7, 2007 QUOTE(Jo-Jo @ Dec 5 2007, 11:53 PM) So I've been working with the OpenGL stuff for about a year or so on and off, and I have become pretty proficient. There is one thing that I can't seem to figure out, however. I have been trying to control the camera using the setup camera method, and I can't figure out what the up direction is. I thought it described a (unit) vector that pointed out of the top of the camera, but I'm certain that this is not the case, although it seems to be the case sometimes, however in some positions the camera inverts itself. The help files on this method are not useful, which is pretty much the case for most of the OpenGL stuff, unfortunately. Does anyone know how to use this method?~Jo-Jo In Labview 8.2 (8.5) is the newer 3D toolbox Here is the online help: Here you find a video from a 3d object... http://forums.lavag.org/index.php?showtopi...ost&p=20308 Quote Link to comment
Jo-Jo Posted December 7, 2007 Author Report Share Posted December 7, 2007 QUOTE(martin@aerodynamics @ Dec 6 2007, 07:07 AM) In Labview 8.2 (8.5) is the newer 3D toolboxHere is the online help: Here you find a video from a 3d object... http://forums.lavag.org/index.php?showtopi...ost&p=20308 These help files deal with the built-in camera controller. There is no reference to the method I mentioned in my post. Has anyone here figured out how to successfully use the Setup Camera method? I'm starting to think that it actually doesn't work. I received no response from anyone on the NI developers forum either. I sent an email to NI's application engineers, but I haven't heard from them yet either. I can manipulate the OpenGL camera using C++, and I'm not new to OpenGL, or LabVIEW, (so don't assume that I'm screwing it up in some simple way) but in LabVIEW the only way the give to use the camera is with the Setup camera method, and I have yet to see a demonstration of it working other than putting the camera in a static position with the up direction parallel to the positive Y axis. Quote Link to comment
crelf Posted December 7, 2007 Report Share Posted December 7, 2007 QUOTE(Jo-Jo @ Dec 7 2007, 04:39 AM) I received no response from anyone on the NI developers forum either. I sent an email to NI's application engineers, but I haven't heard from them yet either. This is a really specialised area of LabVIEW - I suggest you call them. You might need to wade through the front-line AEs, but you should be able to talk to someone who knows OpenGL in LabVIEW. QUOTE(Jo-Jo @ Dec 7 2007, 04:39 AM) ...I'm not new to OpenGL, or LabVIEW, (so don't assume that I'm screwing it up in some simple way)... I don't assume it, but I don't necessarily discount it either - we all screw up in simples ways from time to time Quote Link to comment
TobyD Posted December 7, 2007 Report Share Posted December 7, 2007 QUOTE(Jo-Jo @ Dec 6 2007, 10:39 AM) in LabVIEW the only way the give to use the camera is with the Setup camera method, and I have yet to see a demonstration of it working other than putting the camera in a static position with the up direction parallel to the positive Y axis. Have you checked out the solarsystem.vi in the labview\examples\picture\3D Picture Control directory. It might have what you need. Quote Link to comment
Jo-Jo Posted December 7, 2007 Author Report Share Posted December 7, 2007 QUOTE(TobyD @ Dec 6 2007, 09:47 PM) Have you checked out the solarsystem.vi in the labview\examples\picture\3D Picture Control directory. It might have what you need. The solar system VI sets up the camera with the top of the camera parallel to the positive Y axis, and then doesn't move it except with the built-in grabby cursor. What I'm trying to do is move the camera to anything location with an arbitrary orientation. I worked out the math, it is the same as for any object, but the camera does not seem to be responding properly. I have an email into NI. If I hear anything, I'll let you guys know. This method is very important, I can't believe I'm the only one trying to use it, but so far I haven't found anyone who is trying to use it except to establish a static view. Quote Link to comment
Jo-Jo Posted December 8, 2007 Author Report Share Posted December 8, 2007 Alright, I got it. This is a little counterintuitive, so try to stick with me here, as I'm sure I won't be the only one to run into this problem. So when the camera is translated the target is the point the camera is looking at in the absolute coordinates of the scene. The up direction, however, is the direction the top of the camera is pointing in relative to the camera. To complicate things more, the camera can be thought of as having its own coordinate axes apart from the scene axes, as is ture of every other OpenGL object, which is what the up direction vector uses, but these axes do not rotate with the camera, which is what happens with every other OpenGL object. On a related note, you can get the most amount of control from the camera by making the target a unit vector that moves with the camera, so the camera is always focused a distance of one in front of itself. As an example check out the following setup: If the camera is at the following location: 10,10,10 and it is rotated in pi/2 radians around X axis. The target (using the above unit vector method) will be: 10,11,10 But the up direction will be: 0,0,1 The moral of the story is: Don't think of the target and up direction as two vectors 90 degrees out from each other with their tails at the same point in the same coordinate system. Hope this helps. ~Jo-Jo Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.