3D Viewport problems with 3D Editor...

Blitz3D Forums/Blitz3D Programming/3D Viewport problems with 3D Editor...

Kozmi(Posted 2004) [#1]
Hi All...

I am having this problem with my 2D viewports for my 3D map
editor im' designing right now. What the problem is, Is this:

I have 4 viewports... ( As most 3D map editors do!! )
Im' trying to get my "Top", "Side", "Back" view to come up
in a wireframe like 2D projection view for the 3D objects
in my maps... I want to be able to click on the 2D view of
the objects in either one of the views mentioned above
and be able to move my 3D objects in the given direction
according to that of the current 2D view im' working with!
I also want to be able to show the 3D objects in the
perspective view rendered normally!! ( Textured that is!! )
all at the same time as most 3D map editors do now a days.
I would like to get my 2D views to look like that of "CShop"
or "Quill3D"... Does anybody know of any good tutorials on a matter like this, Or better yet... Maybe a code sample
to help explain some of the mystery involved here?!?

Any help on this matter would be very, very appreciated!!!

Thank's alot to All...


Sweenie(Posted 2004) [#2]
No need to post twice.

Anyway,
* create four camera viewports.
* Set Wireframe to true.
* Hide the perpective/nonwireframe camera
* render(renderworld)
* set wireframe to false
* hide the other cameras and show the perspective camera
* render

You might want to change the projection mode to orthograpic for the wireframed views.


_PJ_(Posted 2004) [#3]
And...as Flynn pointed out in your other post on this topic:


Instead of hiding the camera you should use :-

CameraProjMode cam,0

It's much much faster...



________________________________________


I am at work, with no access to blitz, but here's some code that should help (may be a coupla errors ;) )













graphics3d 800,600,32,0
setbuffer backbuffer()

topcam=createcamera()
sidecam=createcamera()
frontcam=createcamera()

cameraviewport topcam,0,0,400,300
cameraviewport sidecam,400,300,400,300
cameraviewport frontcam,0,300,400,300

rendercam=createcamera()
cameraviewport rendercam,400,0,400,300

whatever=createcube()

positionentity whatever,0,0,0

positionentity topcam,0,30,0
positionentity frontcam,0,0,-30
positionentity sidecam,-30,0,0

positionentity rendercam,20,-20,10

entityparent topcam,whatever
entityparent sidecam,whatever
entityparent topcam,whatever

while not keydown (1)

if keydown(200) then translateentity whatever,0,0,1
if keydown(208) then translateentity whatever,0,0,-1
if keydown(203) then translateentity whatever,-1,0,0
if keydown(208) then translateentity whatever,1,0,0


pointentity topcam,whatever
pointentity sidecam,whatever
pointentity frontcam,whatever

pointentity rendercam,whatever

wireframe 0

hideentity topcam
hideentity sidecam
hideentity frontcam

showentity rendercam

updateworld
renderworld



wireframe 1

showentity topcam
showentity sidecam
showentity frontcam

hideentity rendercam

updateworld
renderworld


flip

wend

endgraphics
end


Kozmi(Posted 2004) [#4]
@Sweenie


I ended up posting here twice because I got to thinking
that alot of other Blitz3D users may of thought this this
post was in the wrong forum due to the previous post's
topic Title and all, And that's why I posted twice with
a different topic title in hope to get a reply to my
question here... Sorry about the cunfusion?@#$%

@Malice

And thank's for pointing that out to me because I forgot
about it.... thank's also for the code snippit too!