on 11-06-2012 02:30 AM
Hi guys
I'm building a game using the GameEngine2D and is working great
but now I want to add a 3D element on top of it,
how can I do that?
is just 3D elements on top, like in another layer totally separate.
thanks for the help.
on 12-06-2012 11:26 AM
on 12-06-2012 04:12 PM
Thanks James
it would be very helpful to have an example of that
cause I'm having another issue with updates and that might help with that too.
thanks again
on 12-06-2012 04:57 PM
Not a problem ![]()
I'll use BasicModelSample as a basis to overlay a GE2D SpriteUV on top of the 3D model (like a HUD).
1. You'll first want to delcare another static variable for the BasicModelSample class, as follows:
public static Scene scene;
2. We can then initialize the Director, instantiate the Scene and then setup the SpriteUV in the Init() method.
Director.Initialize(300, 300, graphics);
scene= new Scene();
scene.Camera.SetViewFromViewport();
Texture2D text = new Texture2D("/Application/shoot.jpg", false);
TextureInfo info = new TextureInfo(text);
SpriteUV sprite = new SpriteUV();
sprite.TextureInfo = info;
sprite.Scale = info.TextureSizef;
sprite.Position = new Vector2(200, 200);
scene.AddChild(sprite);
Director.Instance.RunWithScene(scene, true);By calling RunWithScene() and passing in true for the manual loop, this tells the GameEngine2D library that we'll be handling the calling of the update and render methods that it requires.
3. We now need to call the Update() method on the Director. At the start of the Draw() method in BasicModelSample, add the following line.
Director.Instance.Update();
4. Get the Director to Render().You'll want to place this after the call to graphics.Clear() and before graphics.SwapBuffers()
Director.Instance.Render();
5.Post swap, should be called after the call to graphics.SwapBuffers()
Director.Instance.PostSwap();
Hope this helps,
James
on 12-06-2012 06:09 PM
well, I can run it but I can't see any difference in the result ![]()
can you switch it?, cause I already have all this stuff build using GE2D and I want to add the 3D elements to that
I kinda get what's happening but I don't want to destroy what I already have hehe
thanks
on 15-06-2012 12:57 AM
on 15-06-2012 11:04 AM
on 15-06-2012 03:05 PM
Hey JAmes
yeah it works is on top now, but I can't se the game now, the 3D model comes with the gl clear color, so it's covering the whole thing, how can I just declare like and alpha channel or something.
so what I'm saying is the 3d layer of this mix, has a barkground right, that you declare with the
graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.5f);
and that is what is covering the whole screen and the GE2D layer of the mix is behind that
I'm thinking, set the model as it's alpha to blend it or something, set the clear color to nothing, but that's silly ![]()
thanks for the help man you rock!!
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870