I have a question, how to make a correct Camera Panning ?
I Explain :
I've created a "CameraTop" with this parameters :
csInfinitePerpective, Direction(0,-1,0), Position(0,50,0) and Up(0,0,1) and no CameraTarget attached
But now how can i calculate the orientation for keeping objects paralelle with the XZ plane
I've lost my old code and don't remember how to do.
In my mind if i'm right i must use glsceneViewer.ScreenVectorIntersectWithPlaneXZ procedures and make a cross vector product with a thing ????
Have you any clues ? i've trie to search over the web but with no success.
I also try to use csOrtho2D but with no succes. I don't understand correctly how it work.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jerome,
It's an attractive idea to create four cameras and four frames like in 3ds max, but there will be additional difficulties in coding and manipulation further. It's better and enough to have for the editor only two cameras in glsceneviewer windows with perspective and ortho view. See scenenav and look at navicube demos in attachments.
PW
Yes it's attractive but for now i'v just plane to use One glsceneviewer but with some camera like Top, Left, Front, perspective for editing and a Free camera just for see the final render directly.
In the past i've made a system with 4/5 views and worked like a charm (front/back, left/right, top/bottom and pespective). But this is the code i lost.
I also used two GLScenes and two MaterialsLibrary.1 for editing and display the objects as wireframe or point and for using helpers like grids and gizmo and the second just for final textured scene without any editing helpers.
I tested sweet home and it has 2 view 1 top and 1 for perspective so i'd like to do similar thing first. And After it will be easy to set left/right front/back and a bottom view with the tag property or with the help of an array
And for a giszmo like sweet it's possible, but not if we don't know how to intersect the camera and the view plane correctly
I'll post a sample soon as possible
Thanks Pavel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm glad to attach a little demo for showing how Camera can be handle for different views.
Sorry for Delphi users. I'm using Lazarus/CodeTyphon (http://www.pilotlogic.com/)
But you'll can convert this demo. It's easy open the unit1.pas for see what components and units are used. Create new project and add the components on your form. After, just copy the code in the implementation part and set the right procedures to the right components's event. In the archive you'll find "test.gls" just load it in your TGLScene.
In the archive you'll find 2 binaries one is 32bits and the other the 64bits version for windows.
If you're using lazarus or CodeTyphon under Linux or Mac this demo should compile without problems.
Quick Description : You have 2 views. On the left you can choose the camera (top, left, front or perspective) and you can move the camera with Right Mouse Button.
On the right you have the Perspective View, you can Rotate around the Camera Target with Center Mouse Button. And Zoom in and out with the wheel.
For now you can't move camera if you choose Perspective (it will be available soon, i must do some others tests).
The movement need to be more accurate.And rendering must be adjusting (In old release of GLScene this was ok, probablybecause the Perspective Projection Matrix was not 100% correct )
I'm using CodeTyphon GLScene is include by default
--> 02-09-2015 ver 5.5.2 Synchronize with Source SVN Rev 6676
I never manged to install GLScene Under Lazarus properly so this why CodeTyphon is genious and it include many many components by default the only bad thing with CT is you cannot choose package at the setup for now
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jerome,
I'm using the Lazarus as well, but bit of an old version of it 0.9.30 and old GLScene version, your project didn't compile on my machine but anyway since having the code snippets shouldn't be difficult to port it.
Panning in perspective view is bit of challenging I use the GLCamera.MoveTargetInEyeSpace and GLCamera.MoveInEyeSpace procedures but its bit of awkward during panning, probably you know these functions but just wanted to remind, instead of panning techinque, zoom in mouse direction is more effective for the end users.
regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use the GLCamera.MoveTargetInEyeSpace and GLCamera.MoveInEyeSpace
In my first test i used them.
I'm back with a new and more advanced test (see the attachements)
Now camera movement is more accurate; I'm using another way.
The method used in latest test it's more do for moving object with a "Perspective" Camera
In this new test i've include more options like fit/reset view.
For panning view hold down the buttons on top right of each view and you can constrain Axis with CTRL and ALT key
For Free camera you can also constrain the third Axis with Hold Down CTRL+SHIFT Key
For Zooming just wheel mouse under the viewer
Now the bugs :
I'v tried to implement TGLGizmoEx but it's not work.
Can you Help Me ?
I've also try to draw a FrameRect with GLCanvas on the current selected view but not work.
Can You Help Me ?
I'm also discovering bug with GLViewerBeforeRender Event. It don't work correctly when we use more than 1 viewer under Lazarus (i think it's a bug with LCL) So if someone can make a little test with DELPHI for checking (see the comments in code source for more informations)
Jerome,
I've tried to run your test2 exe and found that only zoom by wheeling is working. For panning view any hold downs or clicking buttons have no effect. What about including hints for buttons? TGLGizmoEx is working for RAD Studio (Delphi/C++Builder) in official demos as well as usual. Sorry, it may be that the problem appears after conversion to Lazarus/Typhon.
PW
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For panning view any hold downs or clicking buttons have no effect.
For Panning or rotating when you click on buttons you must keep the left mouse button pressed while you move
TGLGizmoEx is working for RAD Studio
The TGLGizmoEX Sample work well in Lazarus to. But it not work here I think it's due to multiple view and it's like the bug with the BeforeRender procedure
For Drawing on Canvas i've also tried with the PostRender Event it's the same it's not work
I'm think it must have bug with LCLViewer. It's probably due to a wrong pointer which is not initialized correctly or it's sharing the same memory space or a thing like that.
For example with the BeforeRender Event if you use only 1 GLSceneViewer it's ok we can access to all properties like "Camera" with TGLsceneViewer(Sender).Camera. But if we're using more than 1 TGLSceneViewer at same time, it's like you haven't got any objects initalized (even the "Tag" property of the "Sender" is not available, it always return 0)
I'll try to track this bug in glscene lazarus code and I'll ask to sternas on pitologic if he can help us.
(For information Sternas he's the author of the GLScene Editor "Cosmo4D " and he the administrator of CodeTyphon)
Jérôme
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jerome,
I've just installed Typhon64 IDE v.5.5 and compiled GLGismoEx demo that was in installation samples. It works the same good as in GLScene's trunk SVN for RAD 10 (in win 10). While I remember about keeping the left mouse button to pan or rotate objects I can't move objects in your test2 example. Sorry.
PW
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jerome,
It would be nice if Sternas could find a time to help in developing the new GLScene Editor like Cosmo4D with advanced possibilities, including a mode for Occulus Rift stereo editing. It must put forward Typhon in mass.
PW
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm back with new demo but with only 1 viewer and ALL WORK FINE !!!
Gizmo didn't work in last demo due to Bad initiliazing
GLCanvas with PostRender Event work now but cause a little flickering on my pc. In this demo I'm using a DirectOpenGLRender to draw the FrameRect
So for next, i think i'll use only 1 Viewer until i can install DELPHI RAD Studio on my PC
It would be nice if Sternas could find a time to help in developing the new
Yes it will be nice. We already have GLScene Updated so perhaps we can synchronize the CT GLScene Code with the official SVN
I say Sternas has no longer the code of Cosmos4D and he's very busy with the developpment of CT but he make update of GLScene as soon as possible and try to made it better for compatibility with LCL/Carbon ect....
Occulus Rift stereo editing
What it's that i don't understand. I know stereo but not "Occulus Rift "
Last edit: Jerome.D (BeanzMaster) 2015-10-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jerome
wrote:
**I know stereo but not "Occulus Rift "
Hm, then you need to read about it in http://www.wikiwand.com/en/Oculus_Rift
and particularly Development Kit2 section.
If there will be cross-platform version of GLSceneEditor then
it could be incorporated in any smartphone for using with OR
or supporting other VR devices.
PW
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Quite good effort I really like the undo/redo functionality and polygon/lasso/free hand tool selection even it doesn't operate properly, one view seems to be better option.
I noticed one thing, screen rendering has some lag when I zoom/drag/pan into scene, even though FPS are quite moderate such as 30-40 FPS and I still experience some lags, I tested with x32 and x64 still experience the same. my machine is 8.1 Winx64 AMD Radeon r7 m265 graphic card.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jerome,
Yes, test3 with one 1 viewer is working. Well, so why then do not start the project
from workable version of GLGizmoEx demo? There are many inplemented features ready.
PW
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes Pavel i'm alreadystart and i've already a basic UI that is inspired by Lightwave. If i have enought time this week i think i'll can present you a little beta soon.
Now i say how to manage Camera and GizmoEx correctly :)
SBlade
noticed one thing, screen rendering has some lag when I zoom/drag/pan into scene, even though FPS are quite moderate such as 30-40 FPS and I still experience some lags
I've notice this to. This is due to GizmoEx when is enabled and the drawing of GLCanvas (it will be remove next)
Last edit: Jerome.D (BeanzMaster) 2015-10-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi to all i started a GLScene Editor Project.
I have a question, how to make a correct Camera Panning ?
I Explain :
I've created a "CameraTop" with this parameters :
csInfinitePerpective, Direction(0,-1,0), Position(0,50,0) and Up(0,0,1) and no CameraTarget attached
But now how can i calculate the orientation for keeping objects paralelle with the XZ plane
I've lost my old code and don't remember how to do.
In my mind if i'm right i must use glsceneViewer.ScreenVectorIntersectWithPlaneXZ procedures and make a cross vector product with a thing ????
Have you any clues ? i've trie to search over the web but with no success.
I also try to use csOrtho2D but with no succes. I don't understand correctly how it work.
Thanks
Jerome,
It's an attractive idea to create four cameras and four frames like in 3ds max, but there will be additional difficulties in coding and manipulation further. It's better and enough to have for the editor only two cameras in glsceneviewer windows with perspective and ortho view. See scenenav and look at navicube demos in attachments.
PW
Last edit: Pavel Vassiliev 2015-10-14
Yes it's attractive but for now i'v just plane to use One glsceneviewer but with some camera like Top, Left, Front, perspective for editing and a Free camera just for see the final render directly.
In the past i've made a system with 4/5 views and worked like a charm (front/back, left/right, top/bottom and pespective). But this is the code i lost.
I also used two GLScenes and two MaterialsLibrary.1 for editing and display the objects as wireframe or point and for using helpers like grids and gizmo and the second just for final textured scene without any editing helpers.
I tested sweet home and it has 2 view 1 top and 1 for perspective so i'd like to do similar thing first. And After it will be easy to set left/right front/back and a bottom view with the tag property or with the help of an array
And for a giszmo like sweet it's possible, but not if we don't know how to intersect the camera and the view plane correctly
I'll post a sample soon as possible
Thanks Pavel
Hi All,
I'm also interested with composite viewer, it will be a better to have top, front, side and 3D perspective views available.
Good luck.. with your try...
I just say that must show the 2D abilities of GLScene..
Thank you...
Hi, I'm glad to attach a little demo for showing how Camera can be handle for different views.
Sorry for Delphi users. I'm using Lazarus/CodeTyphon (http://www.pilotlogic.com/)
But you'll can convert this demo. It's easy open the unit1.pas for see what components and units are used. Create new project and add the components on your form. After, just copy the code in the implementation part and set the right procedures to the right components's event. In the archive you'll find "test.gls" just load it in your TGLScene.
In the archive you'll find 2 binaries one is 32bits and the other the 64bits version for windows.
If you're using lazarus or CodeTyphon under Linux or Mac this demo should compile without problems.
Quick Description : You have 2 views. On the left you can choose the camera (top, left, front or perspective) and you can move the camera with Right Mouse Button.
On the right you have the Perspective View, you can Rotate around the Camera Target with Center Mouse Button. And Zoom in and out with the wheel.
For now you can't move camera if you choose Perspective (it will be available soon, i must do some others tests).
The movement need to be more accurate.And rendering must be adjusting (In old release of GLScene this was ok, probablybecause the Perspective Projection Matrix was not 100% correct )
see pascal peter's Editor here http://www.skinhat.com/pascalpeter
Many Thanks to Pavel for his GLSceneSpace Code (i found solutions in it)
So What do you think of this little demo ? Have you others solutions ? optimizations ?
Best regards
Last edit: Jerome.D (BeanzMaster) 2015-10-15
Jerome,
Good begining. Do you use the current GLScene_LCL branch for Lazarus or a previous version?
PW
I'm using CodeTyphon GLScene is include by default
--> 02-09-2015 ver 5.5.2 Synchronize with Source SVN Rev 6676
I never manged to install GLScene Under Lazarus properly so this why CodeTyphon is genious and it include many many components by default the only bad thing with CT is you cannot choose package at the setup for now
Hi Jerome,
I'm using the Lazarus as well, but bit of an old version of it 0.9.30 and old GLScene version, your project didn't compile on my machine but anyway since having the code snippets shouldn't be difficult to port it.
Panning in perspective view is bit of challenging I use the GLCamera.MoveTargetInEyeSpace and GLCamera.MoveInEyeSpace procedures but its bit of awkward during panning, probably you know these functions but just wanted to remind, instead of panning techinque, zoom in mouse direction is more effective for the end users.
regards,
Hello I suggest you tou update Lazarus with the latest version 1.4.4 or try CodeTyphon is awesome :)
Hi to all
In my first test i used them.
I'm back with a new and more advanced test (see the attachements)
Now camera movement is more accurate; I'm using another way.
The method used in latest test it's more do for moving object with a "Perspective" Camera
In this new test i've include more options like fit/reset view.
Now the bugs :
I'v tried to implement TGLGizmoEx but it's not work.
Can you Help Me ?
I've also try to draw a FrameRect with GLCanvas on the current selected view but not work.
Can You Help Me ?
I'm also discovering bug with GLViewerBeforeRender Event. It don't work correctly when we use more than 1 viewer under Lazarus (i think it's a bug with LCL) So if someone can make a little test with DELPHI for checking (see the comments in code source for more informations)
Thanks
That's all folk for today
Best regards
Last edit: Jerome.D (BeanzMaster) 2015-10-17
Jerome,
I've tried to run your test2 exe and found that only zoom by wheeling is working. For panning view any hold downs or clicking buttons have no effect. What about including hints for buttons? TGLGizmoEx is working for RAD Studio (Delphi/C++Builder) in official demos as well as usual. Sorry, it may be that the problem appears after conversion to Lazarus/Typhon.
PW
Pavel
For Drawing on Canvas i've also tried with the PostRender Event it's the same it's not work
I'm think it must have bug with LCLViewer. It's probably due to a wrong pointer which is not initialized correctly or it's sharing the same memory space or a thing like that.
For example with the BeforeRender Event if you use only 1 GLSceneViewer it's ok we can access to all properties like "Camera" with
TGLsceneViewer(Sender).Camera
. But if we're using more than 1 TGLSceneViewer at same time, it's like you haven't got any objects initalized (even the "Tag" property of the "Sender" is not available, it always return 0)I'll try to track this bug in glscene lazarus code and I'll ask to sternas on pitologic if he can help us.
(For information Sternas he's the author of the GLScene Editor "Cosmo4D " and he the administrator of CodeTyphon)
Jérôme
Please make a 32bit version so i can help as i can... for testing propose...
Thank you...
Jerome,
I've just installed Typhon64 IDE v.5.5 and compiled GLGismoEx demo that was in installation samples. It works the same good as in GLScene's trunk SVN for RAD 10 (in win 10). While I remember about keeping the left mouse button to pan or rotate objects I can't move objects in your test2 example. Sorry.
PW
Jerome,
It would be nice if Sternas could find a time to help in developing the new GLScene Editor like Cosmo4D with advanced possibilities, including a mode for Occulus Rift stereo editing. It must put forward Typhon in mass.
PW
I'm back with new demo but with only 1 viewer and ALL WORK FINE !!!
Gizmo didn't work in last demo due to Bad initiliazing
GLCanvas with PostRender Event work now but cause a little flickering on my pc. In this demo I'm using a DirectOpenGLRender to draw the FrameRect
So for next, i think i'll use only 1 Viewer until i can install DELPHI RAD Studio on my PC
Thanks
For arc-azrael11
This is the 32Bits Binary of the 3rd Test
Pavel
Yes it will be nice. We already have GLScene Updated so perhaps we can synchronize the CT GLScene Code with the official SVN
I say Sternas has no longer the code of Cosmos4D and he's very busy with the developpment of CT but he make update of GLScene as soon as possible and try to made it better for compatibility with LCL/Carbon ect....
What it's that i don't understand. I know stereo but not "Occulus Rift "
Last edit: Jerome.D (BeanzMaster) 2015-10-17
Jerome
wrote:
**I know stereo but not "Occulus Rift "
Hm, then you need to read about it in
http://www.wikiwand.com/en/Oculus_Rift
and particularly Development Kit2 section.
If there will be cross-platform version of GLSceneEditor then
it could be incorporated in any smartphone for using with OR
or supporting other VR devices.
PW
Works great exept of little flickering...
I think one viewer is good for now...
Quite good effort I really like the undo/redo functionality and polygon/lasso/free hand tool selection even it doesn't operate properly, one view seems to be better option.
I noticed one thing, screen rendering has some lag when I zoom/drag/pan into scene, even though FPS are quite moderate such as 30-40 FPS and I still experience some lags, I tested with x32 and x64 still experience the same. my machine is 8.1 Winx64 AMD Radeon r7 m265 graphic card.
Jerome,
Yes, test3 with one 1 viewer is working. Well, so why then do not start the project
from workable version of GLGizmoEx demo? There are many inplemented features ready.
PW
Yes Pavel i'm alreadystart and i've already a basic UI that is inspired by Lightwave. If i have enought time this week i think i'll can present you a little beta soon.
Now i say how to manage Camera and GizmoEx correctly :)
SBlade
I've notice this to. This is due to GizmoEx when is enabled and the drawing of GLCanvas (it will be remove next)
Last edit: Jerome.D (BeanzMaster) 2015-10-18
Pavel
Yes it will be very very cool, it can propulse GLScene in mass , but the Dev Kit box cost $350.00 so perhaps in a near future :)