-
Posts
220 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Elmar
-
-
Maybe i have problems with texture formats. Has Leadwerks Editor so feature?
-
Yes i copied scripts folder.
Now my situation is so: In one scene my controller can't move, only can look around. In other scene he can move, but when i raise speed of controller then collision is not run, and controller become able to pass inside the walk..
Therefore i want to learn principles of this..
-
I know this. But at times when i export model the texture is not exports. And this model in the editor is seen without texture. Maybe there are problems with my model and with my texture. But i want to know are there any ways to set textures to models in the editor?
-
3ds Max
-
How can i set textures to models with editor? What must i do after exporting models?
-
what is the elaboration?
-
There are no any collision in this sample..
-
But in this sample (with framework) there are no collision between controller and scene. How i can add it?
-
I can't find atmosphere (or the atmosphere editor) in the editor. How i can change the options of atmosphere?
-
OK, Everything is good yet)
How i can load the sky material in this code?
-
#include "engine.h"
int main(int argc, char** argv)
{
Initialize();
RegisterAbstractPath("C:\Program Files");
//Create a graphics context
Graphics(800,600);
//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));
//Load a model
TModel scene=LoadModel("abstract::test2_estafet-1.gmf");
if (scene==0) {
MessageBoxA(0,"Error","Failed to load model.",0);
goto exitapp;
}
//ScaleEntity (scene, Vec3(10,10,10));
EntityType(scene,2);
//Create a light
TLight light=CreateDirectionalLight();
RotateEntity(light,Vec3(45,45,0));
//Create a render buffer
TBuffer buffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
TController player=CreateController();
PositionEntity(player, Vec3(100.0, 100.0, 100.0));
EntityType(player,1);
SetBodyDamping(player,0.0);
SetBodyMass(player,1);
SetWorldGravity(Vec3(0,-20,0));
Collisions(1,2,true);
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*20,strafe*20,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();
}
-
How i can load this sky material, without the creating framewerk?
-
Can you show this in code?
-
if you mean the starting height value for the position of the controler then you use PostionEntity as above the Vec3 is three values for that postion Vec3(x,y,z) ... the value for y (5.0 as above) sets the height.
Hello,
The changing co-ordinates PositionEntity only changes the place of start of my controller. But i want to do tall controller. I think that my controller is creeping. When i change co-ordinates and run the program, controller begin in high and then it returns...
-
Is it 100% so that, if the player can stands on the model in game mode in the editor, then i can do it with code, that my controller easy can stand, go with collisions on the same sbx file?
-
-
I try it know. Again the same problem. Player with gun moves of scene..
-
Yes i did it when you say...But i didn't feel any difference...
Is it necessary to create terrain in every scene?
-
I include my model to the editor and close the editor. Then i want to use this sbx file as scene. What you mean when you say set the model?
-
though or through?
-
Not yet. I done Buoyancy, Gravity and Swept collision true. I don't see any difference still. Again my controller cross inside of wall and cross inside of ground...
-
thanks a lot...
-
Make sure you have a lua scriptfor the model to set its collisions, right click the models icon in the right hand window of the editor, select view script. if its blank add:
require("scripts/class") local class=CreateClass(...)
and save, then double click the model and set the collision under the Physics tab.
i didn't understand black part. Can you explain excatly?
-
But in the above code i have done it without any terrain...
Controller
in Programming
Posted
Copying the scripts folder did not change anybody.
Yes i looked this tutorial. I wrote my program under this tutorial...