Jump to content

Umnik

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by Umnik

  1. Hello all. Tell my how to make a statusbar for the boot process the scene. To the player could see the readiness stage for the game.
  2. TPick pick; if(MouseHit(1)) { HideEntity(character); if(CameraPick(&pick,camera,Vec3(MouseX(),MouseY(),200.0))) { PositionEntity(cursor,Vec3(pick.X,pick.Y+0.25,pick.Z)); } ShowEntity(character); } You need use HideEntity() && ShowEntity()!
  3. Thank you very much, you as always excellent, everything works!
  4. Who has any have any thoughts on this matter?
  5. yeah. But my problem is never decided! Here is my new problem:
  6. i find bug. in INI file. Error variant: [FontData] 0Char=32 0A=0 0C=3 0Wid=9 0Hgt=22 0X1=0,0078125 0Y1=0,00390625 0X2=0,04296875 0Y2=0,046875 1Char=33 worked variant: [FontData] 0Char=32 0A=0 0C=3 0Wid=9 0Hgt=22 0X1=0.0078125 0Y1=0.00390625 0X2=0.04296875 0Y2=0.046875 1Char=33 need , replace .
  7. But up to 255 characters there is not one letter of Russian alphabet. How can I be?
  8. my font file: http://dev.ramgames.ru/temp/font.rar i use @Arial Unicode MS 10px
  9. I make cyrillic fonts in Font Studio. I used the instruction: http://www.leadwerks.com/wiki/index.php?title=LoadFont As a result, I do not see not a single letter in the text. Using SetBlend (1) the text disappears completely. SetFont(LoadFont("abstract::cyrrilic")); ... ... DrawText(0,100,"Test Cyrrilic: Привет медвед!"); my font file: http://dev.ramgames.ru/temp/font.rar
  10. Umnik

    GetEntityKey ?

    Thanks! hmm... Model { path="firepit.gmf" position=-2.00000000,0.000000000,-6.00000000 rotation=-0.000000000,-0.000000000,0.000000000 scale=1.00000000,1.00000000,1.00000000 id=205114888 "class"="Model" "intensity"="1.0" "name"="firepit_1" } Return value "Mesh" Return value "Scene Root" This is because I use CameraPick method?
  11. Umnik

    GetEntityKey ?

    DrawText(0,116,"%s",name); I click to model and not see name! Return value (null). What?
  12. Umnik

    GetEntityKey ?

    As with GetEntityKey know Name of the object, such as a firepit model. TPick pick2; if(MouseHit(1)) { HideEntity(character); HideEntity(waycursor); if(CameraPick(&pick2,fw.GetMain().GetCamera(),Vec3(MouseX(),MouseY(),1000.0))) { string name; name=GetEntityKey(pick2.entity,"name"); PositionEntity(cursor,Vec3(pick2.X,pick2.Y+0.25,pick2.Z)); } ShowEntity(waycursor); ShowEntity(character); } ... if (!pick2.entity) { DrawText(0,100,"%s",GetEntityKey(pick2.entity,"name")); } DrawText(0,116,"%s",name); Not Worked ;( Please help me!
  13. Is anyone an give me example please: Handling events on click mouse in Model. I want to create the object NPC and do not know where to start. How work RayCasting I know. I do not understand how to determine the name of the object, then to make a [if] operator. Thanks.
  14. Thanks! This work sample: #include <windows.h> #include <stdio.h> int main() { int WindowWidth, WindowHeight; WindowWidth = GetPrivateProfileInt (TEXT("GRAPHICS"), TEXT("Width"), 0, TEXT(".//setting.ini")); WindowHeight = GetPrivateProfileInt (TEXT("GRAPHICS"), TEXT("Height"), 0, TEXT(".//setting.ini")); printf ("Key: %i\n", WindowWidth); printf ("Key: %i\n", WindowHeight); return(1); } setting.ini [GRAPHICS] Width=800 Height=600 Suddenly, someone will need ...
  15. Hello! Please share an example of reading the program settings from ini file. I would be grateful for any example, thank you!
  16. Who buffer save if i use a Framewerk.h? I obtained only black images
  17. Is anyone a example of how to create a reflection on the water? Without the use of third-party libraries? Thanks!
  18. this-> http://developer.lea...Water_Files.zip to mikedowd729 SkyBox I displayed correctly. I do not booming like never before displaying on the surface of water.
  19. TBuffer gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); TBuffer lightbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH); TBuffer reflectionbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);//gbuffer for rendering reflections TBuffer reflectionlightbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH);//buffer for rendering reflection lighting to ... ... ... TWorld background=CreateWorld(); TMesh skybox=CreateCube(); TCamera skycam=CreateCamera(); FlipMesh(skybox); PaintEntity(skybox,LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")); foreground=CreateWorld(); waterplane=CreateMesh(); TSurface surf=CreateSurface(waterplane); AddVertex(surf,Vec3(0.5,0,-0.5)); AddVertex(surf,Vec3(0.5,0,0.5)); AddVertex(surf,Vec3(-0.5,0,0.5)); AddVertex(surf,Vec3(-0.5,0,-0.5)); AddTriangle(surf,0,2,1); AddTriangle(surf,2,0,3); UpdateMesh(waterplane); PositionEntity(waterplane,Vec3(0,29,0)); ScaleEntity(waterplane,Vec3(2048)); EntityOcclusionMode(waterplane,1); fgcam = CreateCamera(); CameraClearMode(fgcam,0); SetWorld(world); TBody waterbody=CreateBodyBox(20,20,20); EntityType(waterbody,4); PositionEntity(waterbody,Vec3(0,12-10,0)); EntityParent(waterbody,waterplane); SetFluidPlane(Vec4(0.0,1.0,0.0,-EntityPosition(waterplane).Y),0.1); SetFluidDensity(1); SetFluidViscosity(0,0); reflectioncam=CreateCamera(); HideEntity(reflectioncam); TMaterial watermaterial=LoadMaterial("abstract::water.mat"); SetMaterialTexture(watermaterial,GetColorBuffer(reflectionlightbuffer),2); SetMaterialTexture(watermaterial,GetColorBuffer(lightbuffer),3); SetMaterialTexture(watermaterial,GetDepthBuffer(gbuffer),4); TShader watershader=GetMaterialShader(watermaterial); SetShaderFloat(watershader,"visibility",10.0); // Дальность вида в глубину SetShaderFloat(watershader,"softness",10.0); // Прозрачность воды TMaterial underwatermaterial=LoadMaterial("abstract::underwater.mat"); SetMaterialTexture(underwatermaterial,GetColorBuffer(reflectionlightbuffer),2); SetMaterialTexture(underwatermaterial,GetColorBuffer(lightbuffer),3); SetMaterialTexture(underwatermaterial,GetDepthBuffer(gbuffer),4); TShader postfilter=LoadShader("abstract::postfilter.vert","abstract::postfilter_distancefog_wobble.frag"); SetShaderVec4(postfilter,"fogcolor",Vec4(1.02,1.59,1.74,1.0)); SetShaderVec2(postfilter,"fogrange",Vec2(0,5)); wobbletexture=LoadTexture("abstract::wobbledot3.dds"); ... ... ... while( !KeyHit() && !AppTerminate() ) { UpdateAppTime(); UpdateWorld(); //UpdateWorld(AppSpeed()); SetBuffer(gbuffer); SetWorld(background); RenderWorld(); SetWorld(world); RenderWorld(); SetBuffer(BackBuffer()); RenderLights(gbuffer); SetBuffer(lightbuffer); RenderLights(gbuffer); CopyBuffer(gbuffer,BackBuffer(),BUFFER_DEPTH); CopyBuffer(lightbuffer,BackBuffer(),BUFFER_COLOR); if (EntityPosition(camera).Y>EntityPosition(waterplane).Y) { if (!EntityCulled(waterplane,fgcam)) { PaintEntity(waterplane,watermaterial); SetShadowQuality(1);//low-quality shadows are fine when rendering reflections SetBuffer(reflectionbuffer); // Включаем рефлёность воды с отражением ShowEntity(reflectioncam); //Выводим отражение HideEntity(camera); //Скрываем камеру float waterheight=EntityPosition(waterplane).Y; SetCameraClipPlane(reflectioncam,0,Vec4(0,1,0,-waterheight)); TVec3 pos = EntityPosition(camera); TVec3 rot = EntityRotation(camera); pos.Y=waterheight-(pos.Y-waterheight); PositionEntity(reflectioncam,pos); ScaleEntity(reflectioncam,Vec3(1,-1,1)); RotateEntity(reflectioncam,Vec3(-rot.X,rot.Y,rot.Z)); RenderWorld(); //Now render lighting for the reflection SetBuffer(reflectionlightbuffer); RenderLights(reflectionbuffer); //Restore settings ShowEntity(camera); HideEntity(reflectioncam); SetShadowQuality(1); } SetWorld(foreground); SetBuffer(BackBuffer()); SetEntityMatrix(fgcam,GetEntityMatrix(camera)); RenderWorld(); } else { PaintEntity(waterplane,underwatermaterial); SetWorld(foreground); SetBuffer(gbuffer); CopyBuffer(lightbuffer,gbuffer,BUFFER_COLOR|BUFFER_DEPTH); CopyBuffer(lightbuffer,gbuffer,BUFFER_COLOR|BUFFER_DEPTH); SetEntityMatrix(fgcam,GetEntityMatrix(camera)); RenderWorld(); SetBuffer(BackBuffer()); SetShader(postfilter); BindTexture(GetDepthBuffer(gbuffer),1); BindTexture(wobbletexture,7); TTexture tex=GetColorBuffer(gbuffer); TextureFilter(tex,TEXFILTER_SMOOTH); DrawImage(tex,0,TextureHeight(tex),TextureWidth(tex),-TextureHeight(tex)); TextureFilter(tex,TEXFILTER_PIXEL); SetShader(NULL); } } Sample from tutorial clear!
  20. Hello everyone! Today, doing the mapping of water in my project. All done through the lesson. Explain why I do not see the sky on the surface of the water?
  21. I have all earned only after I created a new project through the wizard. I copied your code from the old project into new project and all earned the library engine.dll 2.3.And now the error does not occur. Thanks All.
  22. Hi! I have updated all the DLL files in my project. And when booting I wrote:
×
×
  • Create New...