Jump to content

Recommended Posts

Posted

Hello all, this is my first post as I am new to Leadwerks.

ive been looking for hours and cant find anything on this, ive created a map in the editor and everything was fine till i added a skybox, thats when i noticed this black background. it moves with the camera, and in trying to identify what is was ive realized i can change its color with Camera->SetClearColor((0, 0, 0, 0)); but i cant make it disappear... and help on this would be greatly appreciated.

also, im doing this entirely in c++  i followed this youtube video to get started https://youtu.be/Ndp1tYBS_Yc

1967911014_ProjectTemplate8_15_20198_11_59PM.thumb.png.8a5b37859f516b0df79554244a03b670.png

Project Template 8_15_2019 8_18_48 PM.png

Posted

I'll have to try this when I get home from work today. however, I can't imagine why the camera range would obstruct the skybox which should be infinitely away, Any idea how far out I should set that range?

Posted

image.thumb.png.433fa3b9f6201fd23cd529e10d2135e7.png

 

I think something is wrong, it should work with the default values, I think that at some point something like this happened to me, and I don't know if I fixed it or fixed it, I remember moving the map size values.

image.thumb.png.2fb6289324d6271b468cb39980c2e6ce.png

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Posted

well I've narrowed it down a bit, removing the code that creates the player and camera, and simply adding a camera to the map i get a normal view of the skybox... so its definitely something in my code

maybe someone can tell me if they see anything i may be doing wrong, here is the code that spawns the camera...

struct GamePlayer {
	Camera* PLayerCam;
	Model* CameraMount;
	Model* PlayerModel;
	int PlayerAnimId;
	int currentAngle;
};


GamePlayer CreateLocalPlayer2(Vec3 pos) {
	GamePlayer gamer;
	Model* Mydude = Model::Load("Models/Characters/MyDude/MyDude.mdl");
	Mydude->SetPhysicsMode(Entity::CharacterPhysics);
	Mydude->SetCollisionType(COLLISION_CHARACTER);
	Mydude->SetMass(1);
	int animationsequence = Mydude->LoadAnimation("Models/Characters/MyDude/MyDude.mdl");
	Vec3 v = pos;
	Mydude->SetPosition(v.x, v.y, v.z);
	Model* mount = Model::Create(Mydude);
	Camera* MyMainCam = Camera::Create(mount);
	MyMainCam->SetRotation(55, 180, 0);
	MyMainCam->SetPosition(0, 20, 5);
	gamer.PlayerModel = Mydude;
	gamer.CameraMount = mount;
	gamer.PlayerAnimId = animationsequence;
	gamer.PLayerCam = MyMainCam;
	return gamer;

This image is with a manually added camera (in the editor), the second is when from loading the camera in code

887504231_ProjectTemplate8_16_20198_19_04PM.thumb.png.3671f5397a8086716f0079fce38b0a68.png423060156_ProjectTemplate8_16_20198_23_30PM.thumb.png.af74fa71cf72c93ebf27ca7a46032295.png

Posted

I Fixed it!, problem was solved by changing

Camera* MyMainCam = Camera::Create(mount);

to...

Camera* MyMainCam = Camera::Create();
MyMainCam->SetParent(mount);

not sure why this is any different but hey it works now, also it solved another problem i was having with shadows not rendering :)

1501822228_ProjectTemplate8_16_201910_15_30PM.thumb.png.c6ea464e2ff84623f81999a8f06d2827.png

 

  • Like 2

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.

×
×
  • Create New...