Showing 3D Objects in a 2D viewport???
Blitz3D Forums/Blitz3D Programming/Showing 3D Objects in a 2D viewport???
| ||
Hi Guys... I kinda' am in need of some help on this one!!! I looked through the code archives in hope to find a function set Or a library that will help me in creating 2D viewports for my 3D Level Editor to show 3D Objects in a 2D viewport or window!! The editor naturaly has "Top View", "Side View", "Back View", and ofcourse the "3D View" as well... Your usaul viewing windows for a level editor... Does anybody know where I might be able to find some example code or documentation on how to code this? I would greatly appreciate this very much so... Thank's All... |
| ||
CameraProjMode 2 I think gives orthograophic view. Really, just create separate cameras for each view and position them accordingly. Set the CameraViewport for each camera as a quarter of the screen size etc. I did this a while ago for a project. When I get home, I'll dig out the code and slap it somewhere for downloading if you need it, or the explanation above isn't very good! |
| ||
Ok... Thank's a bunch man!!! However though, I do got to admit that I did think about adding 3 more camera views & setting them to view wire frame objects only though! But I guess will see huh! |
| ||
That's not so difficult,if you duplicate the cameras. Once the cameras are all set up, I'm sure you can parent each set to pivots, i.e. EntityParent FRONTNORMALCAM,NormalPivot EntityParent SIDENORMALCAM,NormalPivot EntityParent PLANNORMALCAM,NormalPivot EntityParent FRONTWIRECAM,WireFrPivot EntityParent SIDEWIRECAM,WireFrPivot EntityParent PLANWIRECAM,WireFrPivot so you could have something like: (pseudo-ish code only) If Wires$="Y" ShowEntity WirefrPivot HideEntity NormalPivot EndIf |
| ||
I got 3 of the view's up on the editor last night, however though, Im' trying to get only the 3 views to display wireframe mode while ofcourse the other displays normal 3D rendering mode... I havn't gotten to that part as of yet! But when I type into the main loop the "WireFrame True" Then all cameras show the wireframe mode including the 3D Perspective camera as well!!! Any suggestions??? |
| ||
Yeah you have to render twice. Once in wireframe, then again, using different cameras for the normal view... Wireframe 1 ShowEntity WirefrPivot HideEntity NormalPivot EndIf UpdateWorld Renderworld Wireframe 0 HideEntity WirefrPivot ShowEntity NormalPivot EndIf UpdateWorld Renderworld |
| ||
Instead of hiding the camera you should use :- CameraProjMode cam,0 It's much much faster... |
| ||
Thank's for your help guys, I appreciate it alot! |
| ||
Instead of hiding the camera you should use :- CameraProjMode cam,0 It's much much faster... Thanks Flynn :) |