#1




viz.noprojection()
Hi,
Andy Beall tried to implement a new function for the project I am working on but it does not work and he is currently away. I thought maybe you could help me with it. Basically you will find attached the files he sent me and following is the email he sent along. However the new function viz.noprojection is not working since, as soon as an object is loaded, it is viewed correctly, when it should not. David Here's the updated version of winviz and viz.py You'll need to use these to replace their existing counterparts in the /vizard folder (in the /vizard/bin and /vizard folders, respectively). There's a new viz command called viz.noprojection(). Calling that toggles between locking the GL_PROJECTION matrix as the identity or the standard perspective camera. Applying the command pretty much obliterates the rendering for now until you figure out how to combine the PROJECTION and MODELVIEW together. There's a script called matrices.py in the /vizard/tutorial folder that shows how to use transform object and the update() command to replace the MODELVIEW matrix with an arbitrary 4x4 matrix. Since I haven't actually tried updating with a combined PROJECTION and MODELVIEW myself, I'd suggest doing a few real simple examples (maybe see GL Redbook) to just verify that the overall theory does indeed work. If you're having trouble, then either we are off on how to go about this or there's something wrong with what I've done. Anyway, let me know before you spend too much time thrashing. Andy 
#2




Hi David,
Andy never told me about this, so I'm not sure exactly how this is supposed to work, but I went ahead and played around with it a little. Here's the new 'winviz.exe' file. Place it in the Vizard/bin directory. Please get back to me once you've tried it out so that I know it worked. Good luck!  farshid 
#3




thanks Farshid,
It seems not to be working, which is a good start ;o) I have to do some more testing though to check that everything is going as expected and I'll keep you informed. David 
#4




Well after a few test I am more and more puzzled. What Andy told me was that the noprojection() method would disable the perspective projection matrix by setting it to the identity. So I called the method and tried to update the viewing matrix by :
1 creating the matrix R generated by the OGL code glfrustrum(l,r,b,t,n,f). I found its expression in the red OGL book (appendix F of second edition) This is the perspective matrix that should have been set to the identity with viz.noprojection() 2 updating objects and/or main view point with R hoping that I will get the same result as when I just load the objects without the command noprojection() But with none of these cases I get what I expect... Which brings those questions: Where exactly is the viewing matrix hidden? Is it really what I am updating when I say <child>.update(matrix) or <viewpoint>.update(matrix)? Is the perspective matrix right before the view matrix in the order of matrices multiplications? Is the matrix in the red book correct and if yes, is it consistent with what viz uses? Did I miss an important point? Thanks a lot for trying to answer those questions David 
Thread Tools  
Display Modes  Rate This Thread 

