Jump to content

create and rendering another world w/framework


Rick
 Share

Recommended Posts

So I'm trying to create another world along side framework and I'm wondering if I'm doing some things correctly in the C# library. I'm also using Klepto's control.

 

Inside the controls init event I create my world, and it's camera, set that to the current world, then load a mesh. Then set it back to the main layers world.

topWorld = new World();
           Leadwerks.World.Current = topWorld;
           topCamera = new Camera();

           // load model
           xAxis = Mesh.Load("abstract::x_red.gmf");
           xAxis.Position = new Vector3(0, 0, 0);

           Leadwerks.World.Current = Leadwerks.Framework.Layers.Main.World;

 

In AfterRender I switch the current world to the top world, set that camera's matrix to the main layers camera matrix, clear the depth buffer to what I assume would be the currently selected buffer, render the world, then set the current world back.

 

 

All this results in nothing being displayed on the screen. What am I missing? If I take all the extra world stuff out and just load the mesh in the main layers world I see the mesh.

Link to comment
Share on other sites

This isn't just for 3D, it's also for moving axis controls on selected models in an editor. I'm using 3D models for these axis controls and they need to be drawn on top always. Either way, I'm looking for this effect.

 

Also putting them in a non always on top world could lead to issues. I have to worry about models coming between the planes and my camera, I have to worry about lighting in whatever world they exist in, and I wouldn't want post processing effects to be on the GUI controls.

Link to comment
Share on other sites

Wait until right before your flip commands, set the world, render it, set back.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

When I did this in C w/o the framework it seemed I had to also do CameraClearMode(topCamera, BUFFER_DEPTH); with my topCamera and then it worked. Now I have to test with a normal C# program to see if that works, and if that works I then need to figure out how to get it to work with kelpto's control because currently it's not working.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...