-
Posts
220 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Elmar
-
-
what type of file are you trying to upload?
first .sbx, then .rar
-
I can't attach this file. Error You aren't permitted to upload this kind of file
-
Well ok, but thats not enough information to work with. whats in the scene? by falling do you mean through the scene ?
2) yes
1) don't know how to answer. upload the scene?
-
What do you mean by you have changed your map? do you mean you have loaded the .gmf as part of a scene (.sbx) ?
No, i have loaded quite other sbx file instead of gmf file.
-
I have changed my map and my controller became falling again. What am i doing wrong? What i must take the control?
-
If i want to change .gmf file into .sbx file in this code, must i do any other changing?
-
What is the best way to import .DEM file to editor? What do you advice me?
-
to increase or to decrease
-
Thank you Marleys Ghost, it's working now. How can regulate height of player?
-
-
Is this still a problem?
yes(
-
How i can regulate the distance seen in Editor? In other words, i am in the one side of mountain and my map is in the another side of this mountain. How i can resolve this problem?
-
when you say moves off screen do you mean fall ?
yes
-
Must i regulate altitude always manually? When i open the DEM with Global Mapper it is done automatically. But in Leadwerks i don't know what to set to altitude...
-
Thank you
-
-
ok, i will again think about this code...
-
#include "engine.h"
int main(int argc, char** argv)
{
Initialize();
//Create a graphics context
Graphics(1280,768);
//Create a world
if (!CreateWorld()) {
MessageBoxA(0,"Error","Failed to create world.",0);
goto exitapp;
}
//Create a camera
TEntity cam=CreateCamera();
CameraClearColor(cam,Vec4(0,0,1,1));
PositionEntity(cam,Vec3(0,2,-10));
Collisions(1,2,true);
//Load a model
TModel scene=LoadModel("c://scene.gmf");
if (scene==0) {
MessageBoxA(0,"Error","Failed to load model.",0);
goto exitapp;
}
EntityType(scene,2);
//Create a light
TLight light=CreatePointLight();
PositionEntity(light,Vec3(0,5,0));
//Create a render buffer
TBuffer buffer=CreateBuffer(1280,768,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
TController player=CreateController();
EntityType(player,1);
SetBodyMass(player,1);
SetBodyDamping(player,0.0);
SetWorldGravity(Vec3(0,-20,0));
float move=0.0;
float strafe=0.0;
TVec3 camrotation=Vec3(0);
float mx=0;
float my=0;
HideMouse();
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
//Main loop
while(!KeyHit(KEY_ESCAPE)) {
//Camera looking
mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
my=Curve(MouseY()-GraphicsHeight()/2,my,6);
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
camrotation.X=camrotation.X+my/10.0;
camrotation.Y=camrotation.Y-mx/10.0;
RotateEntity(cam,camrotation);
//Player movement
move=KeyDown(KEY_W)-KeyDown(KEY_S);
strafe=KeyDown(KEY_D)-KeyDown(KEY_A);
//Jumping
float jump=0.0;
if (KeyHit(KEY_SPACE)) {
if (!ControllerAirborne(player)) {
jump=4.0;
}
}
//Run
if (KeyDown(KEY_LSHIFT)||KeyDown(KEY_RSHIFT)) {
if (!ControllerAirborne(player)) {
move*=2.0;
strafe*=2.0;
}
}
//Set controller input
UpdateController(player,camrotation.Y,move*3,strafe*3,jump,500.0f);
//Update the world
UpdateWorld();
//Position the camera
TVec3 playerpos=EntityPosition(player);
TVec3 camerapos=EntityPosition(cam);
camerapos.Y=Curve(playerpos.Y+1.75,camerapos.Y,2.0);
camerapos=Vec3(playerpos.X,camerapos.Y,playerpos.Z);
PositionEntity(cam,camerapos);
//Render the scene
SetBuffer(buffer);
RenderWorld();
//Render lighting
SetBuffer(BackBuffer());
RenderLights(buffer);
//Swap the front and back buffer
Flip();
}
exitapp:
return Terminate();
}
-
it doesn't work again (
-
But when i add it my controller became very heavy and it began to move off scene. Maybe i do any another mistake?
-
I have the same problem, but i can't resolve this problem. Can you show me in the code above what you say?
thanks.
-
In this error there also are written any digits. What mean these digits?
-
When i want to import any height map, occuries error like this: <<raw data stream size does not match requested size.>> What does it mean?
-
Thank you...
Controller
in Programming
Posted
It's my map. There is not everything ok with texture, but take no notice of him..
lead.zip