Activity for EugeneLoza

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    You are almost there! The only thing is that SecondsPassed just gives frame duration, not total time since some event. This means you have 33-62 frames per second running. E.g. you can do it this way: procedure TPlayer.Update; begin Self.InternalTime += CastleControl1.Fps.SecondsPassed; {this way we increase internal time by SecondsPassed each frame; obviously, you'll have to call Player.Update for this feature to work correctly} if Self.AnimationDuration < Self.InternalTime then begin Self.CurrentAnimation...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    You are almost there! The only thing is that SecondsPassed just gives frame duration, not total time since some event. This means you have 33-62 frames per second running. E.g. you can do it this way: procedure TPlayer.Update; begin Self.InternalTime += CastleControl1.Fps.SecondsPassed; {this way we increase internal time by SecondsPassed each frame; obviously, you'll have to call Player.Update for this feature to work correctly} if Self.AnimationDuration < Self.InternalTime then Self.CurrentAnimation...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I confess that I'm not really a lover of 2d but rather of 2.5d. Then you might also like the fact, that TCastle2DScene is compatible with 3D world. I.e. in Castle Game Engine you can mix 2D and 3D objects freely (e.g. character sprites and 3D or pseudo-3D environment). I didn't try it yet, but it doesn't seem too difficult. As of 2.5D you might want to look at orthographic projection for 3D world (unfortunatly I don't have any experience here - I just know it should work out-of-the-box) or using...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Valter Buccina, hi! Unfortunately in practice I've never had so many animations in one class before. And my animations approach for 3D models was relatively complex, because I needed a lot of control over them. So, first thing first: this is an overkill and inefficient solution, but it answers your question directly: Variant A: const AnimationLeft = 1; AnimationRight = 2; type TPlayer = class private MyAnimation1, MyAnimation2: TSprite public CurrentAnimationID: Integer; function CurrentAnimation:...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Valter Buccina, hi! Unfortunately in practice I've never had so many animations in one class before. And my animations approach for 3D models was relatively complex, because I needed a lot of control over them. So, first thing first: this is an overkill and inefficient solution, but it answers your question directly: Variant A: const AnimationLeft = 1; AnimationRight = 2; type TPlayer = class private MyAnimation1, MyAnimation2: TSprite public CurrentAnimationID: Integer; function CurrentAnimation:...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    P.S. You may also have a look at "middle" solution, TSprite can contain multiple animations, not just one. You can load all the animations into a single TSprite - see https://castle-engine.io/apidoc-unstable/html/CastleGLImages.TSprite.html#AddAnimation and https://castle-engine.io/apidoc-unstable/html/CastleGLImages.TSprite.html#SwitchToAnimation

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Valter Buccina, hi! Unfortunately in practice I've never had so many animations in one class before. And my animations approach for 3D models was relatively complex, because I needed a lot of control over them. So, first thing first: this is an overkill and inefficient solution, but it answers your question directly: Variant A: const AnimationLeft = 1; AnimationRight = 2; type TPlayer = class private MyAnimation1, MyAnimation2: TSprite public CurrentAnimationID: Integer; function CurrentAnimation:...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Valter Buccina, hi! Unfortunately in practice I've never had so many animations in one class before. And my animations approach for 3D models was relatively complex, because I needed a lot of control over them. So, first thing first: this is an overkill and inefficient solution, but it answers your question directly: Variant A: const AnimationLeft = 1; AnimationRight = 2; type TPlayer = class private MyAnimation1, MyAnimation2: TSprite public CurrentAnimationID: Integer; function CurrentAnimation:...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Valter Buccina, hi! Unfortunately in practice I've never had so many animations in one class before. And my animations approach for 3D models was relatively complex, because I needed a lot of control over them. So, first thing first: this is an overkill and inefficient solution, but it answers your question directly: Variant A: const AnimationLeft = 1; AnimationRight = 2; type TPlayer = class private MyAnimation1, MyAnimation2: TSprite public CurrentAnimationID: Integer; function CurrentAnimation:...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Valter Buccina, hi! Unfortunately in practice I've never had so many animations in one class before. And my animations approach for 3D models was relatively complex, because I needed a lot of control over them. So, first thing first: this is an overkill and inefficient solution, but it answers your question directly: Variant A: const AnimationLeft = 1; AnimationRight = 2; type TPlayer = class private MyAnimation1, MyAnimation2: TSprite public CurrentAnimationID: Integer; function CurrentAnimation:...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi, Pete Sergeant! Happy New Year to you too! :) Can I create just one CoordinateNode with all the possible vertices, and then assign this to each of the meshes - obviously setting the vertex indices appropriately Yes, you can. I didn't test it but as far as I understand it won't be neither faster nor slower. However, memory usage will be definitely lower this way as the same memory will be reused. That said: However, there is about 70% commonality in the vertices in each set of coordinates. If you...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Hi! You should use TCastleControl to render something on screen. In order to draw some image on a TCastleControl you have to make a TGLImage of your TCastleImage first. E.g. like this: type TForm1 = class(TForm) private MyImage: TGLImage; ... end; procedure TForm1.CastleControl1Render(Container: TUIContainer); //this is an event automatically created by Lazarus begin if MyImage <> nil then MyImage.Draw; end; procedure TForm1.LoadImage; var CastleImage: TCastleImage; begin CastleImage := Load(SomeImageURL);...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi! You should use TCastleControl to render something on screen. In order to draw some image on a TCastleControl you have to make a TGLImage of your TCastleImage first. E.g. like this: type TForm1 = class(TForm) private MyImage: TGLImage; ... end; procedure TForm1.CastleControl1Render(Container: TUIContainer); //this is an event automatically created by Lazarus begin MyImage.Draw; end; procedure TForm1.LoadImage; var CastleImage: TCastleImage; begin CastleImage := Load(SomeImageURL); MyImage := TGLImage.Create(CastleImage,...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Yes. LPI files are actually XML files that are read by Lazarus. They have settings for the project, necessary to compile it, such as required packages, compile modes, etc. If your download changes extension to XML, you can just change it manually back to LPI.

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Wow, new examples! I've missed those ones, and I might need them right now :) Thanks for bringing them to my attention. And thanks @Michalis for making them! :) As for your question. I believe this is a minor error, the example project files were accidentally not uploaded. I've made simple dummy project files, you may use those (see attachments). They will compile and generate executable now automatically. Just place them in corresponding examples folder and run through Lazarus.

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Wow, new examples! I've missed those ones, and I might need them right now :) Thanks for bringing them to my attention. And thanks @Michalis for making them! :) As for your question. I believe this is a minor error, the example project files were accidentally not uploaded. I've made simple dummy project files, you may use those (see attachments). They will compile and generate executable now automatically.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Wow, new examples! I've missed those ones, and I might need them right now :) Thanks for bringing them to my attention. And thanks @Michalis for making them! :) As for your question. I believe this is a minor error, the example project files were accidentally not uploaded. I've made simple dummy project files, you may use those (see attachments). They will compile and generate executable now automatically.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi, Valter Buccina! No, everything's right. This was a deliberate change. In short, so that only visual components do appear at the Castle tab. See detailed comment by @Michalis Kamburelis: https://github.com/castle-engine/castle-engine/commit/5cb6fb2ea3a4159cf7d371b6abde42acc667a515

  • EugeneLoza EugeneLoza posted a comment on ticket #1

    Спасибо за отзыв! Рад, что программа пригодилась! :)

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Do you know a workaround for that? Well, let's put it simple. Each sprite should be scaled based on it's Y. Sprite Y value is individual, so scale should be individual too (of course, it may be done by the equal formula). I'm not exactly sure how it's best to do that in the piece of code above, but I, personally, would have made a method for TPlayer like this: type TPlayer = class(TSomeAncestorClass) (...) public function Rect: TFloatRectangle; (...) end; (...) function TPlayer.Rect: TFloatRectangle;...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    So M.CurrentSprite.Draw(Player.Rect) but also the NPC[1].Rect and NPC[2].Rect. Maybe I've understood you a bit wrong, but I believe it should work this way (if both Player and NPCs have Rectangle field defined in TPlayer) : for M in SpriteList do M.CurrentSprite.Draw(M.Rectangle); P.S. Pay attention that you have NPC[2].Rect defined based on NPCScale, which is calculated for NPC[1]. Also you use NPC[1].CurrentSprite.FrameWidth there.

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Looks strange. I just tested it, and it works flawlessly - the sprites are sorted for me. program Project1; uses SysUtils, Generics.Collections, Generics.Defaults; type TPlayer = class(TObject) Y: Single; end; type TSpriteList = specialize TObjectList<TPlayer>; TSpriteComparer = specialize TComparer<TPlayer>; function CompareSprites(constref Left, Right: TPlayer): Integer; begin Result := Sign(Left.Y - Right.Y); end; var SpriteList: TSpriteList; Sprite1, Sprite2, Sprite3, Sprite4: TPlayer; M: TPlayer;...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Looks strange. I just tested it, and it works flawlessly - the sprites are sorted for me. program Project1; uses SysUtils, Generics.Collections, Generics.Defaults; type TPlayer = class(TObject) Y: Single; end; type TSpriteList = specialize TObjectList<TPlayer>; TSpriteComparer = specialize TComparer<TPlayer>; function CompareSprites(constref Left, Right: TPlayer): Integer; begin Result := Sign(Left.Y - Right.Y); end; var SpriteList: TSpriteList; Sprite1, Sprite2, Sprite3, Sprite4: TPlayer; M: TPlayer;...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Looks strange. I just tested it, and it works flawlessly - the sprites are sorted for me. program Project1; uses SysUtils, Generics.Collections, Generics.Defaults; type TPlayer = class(TObject) Y: Single; end; type TSpriteList = specialize TObjectList<TPlayer>; TSpriteComparer = specialize TComparer<TPlayer>; function CompareSprites(constref Left, Right: TPlayer): Integer; begin Result := Sign(Left.Y - Right.Y); end; var SpriteList: TSpriteList; Sprite1, Sprite2, Sprite3, Sprite4: TPlayer; M: TPlayer;...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Looks strange. I just tested it, and it works flawlessly - the sprites are sorted for me. program Project1; uses SysUtils, Generics.Collections, Generics.Defaults; type TPlayer = class(TObject) Y: Single; end; type TSpriteList = specialize TObjectList<TPlayer>; TSpriteComparer = specialize TComparer<TPlayer>; function CompareSprites(constref Left, Right: TPlayer): Integer; begin Result := Round(Left.Y - Right.Y); //yeah, it should be "round", I've forgotten Y is Single end; var SpriteList: TSpriteList;...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Looks strange. I just tested it, and it works flawlessly - the sprites are sorted for me. program Project1; uses SysUtils, Generics.Collections, Generics.Defaults; type TPlayer = class(TObject) Y: Single; end; type TSpriteList = specialize TObjectList<TPlayer>; TSpriteComparer = specialize TComparer<TPlayer>; function CompareSprites(constref Left, Right: TPlayer): Integer; begin Result := Round(Left.Y - Right.Y); //yeah, it should be "round", I've forgotten Y is Single end; var SpriteList: TSpriteList;...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Have I overlooked something? I'm not 100% sure, but as for me I always forget which value of comparer function means what :) e.g. try function CompareSprites(constref Left, Right: TPlayer): Integer; begin Result := Right.Y - Left.Y; end; and see if it works (yes, you don't need to use Sign here). And yes, don't forget to FreeAndNil(SpriteList); in the end or you get memory leaks. Alternatively, you may just reuse the same SpriteList and if the number of sprites doesn't change through the game, you...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Have I overlooked something? I'm not 100% sure, but as for me I always forget which value of comparer function means what :) e.g. try function CompareSprites(constref Left, Right: TPlayer): Integer; begin Result := Right.Y - Left.Y; end; and see if it works (yes, you don't need to use Sign here).

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    So what could be wrong? oh, I get it. The animation FramesPerSecond is smaller than FPS (which is overall small too). This results in: one frame of the animation is displayed several times while moving in significant jumps and then abruptly changes to another. Solution 1: (recommended) increase animation FramesPerSecond so that it would correspond to sprite movement speed or reduce the sprite movement speed (i.e. the sprite won't move for too many pixels for 1 animation frame). Solution 2: (not recommended)...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Making Scale a member of TPlayer is the a possible solution (so each sprite has its own scale). However, you don't have to store it at all. Just calculate Scale before drawing each sprite - it should be a simple local variable as in Michalis' example: Scale is calculated only based on Y value of the draw call, so it shouldn't affect other sprites on the screen. However, if you want to simulate objects becomming smaller with distance (kinda "Don't starve") you should try using a 3D approach. It's...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi! You can easily output text by TTextureFont.Print / TTextureFont.PrintBrokenString. The simplest way to is using the default font through UIFont.Print, see this example: https://github.com/castle-engine/castle-engine/blob/master/examples/fonts/test_font_break.lpr . Or you can load your own texture fonts or convert TTF fonts to texture fonts, like in this example: https://github.com/castle-engine/castle-engine/blob/master/examples/fonts/font_draw_over_image.lpr

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    The best solution to this problem is using sorting of all the sprites on the screen. I'd say that using a TObjectList is the way to go. See in detail here: https://castle-engine.io/modern_pascal_introduction.html#generic-containers-section I.e. you need to create a TObjectList (from Generics.Collections) and add all the sprite to it, create a comparator that would sort them based on Y value and then just do a for Sprite in SortedSpriteList do Sprite.Draw; (of course, sorting them each time before...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    The best solution to this problem is using sorting of all the sprites on the screen. I'd say that using a TObjectList is the way to go. See in detail here: https://castle-engine.io/modern_pascal_introduction.html#generic-containers-section I.e. you need to create a TObjectList (from Generics.Collections) and add all the sprite to it, create a comparator that would sort them based on Y value and then just do a for Sprite in SortedSpriteList do Sprite.Draw; (of course, sorting them each time before...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    I'm not sure if your approach is wrong, but I'd do it a bit different way. E.g. like this: TLastDirection = (ldRight, ldLeft, ldUp, ldDown); type TPlayer = class (...) SpriteMoving: array[TLastDirection] of TSprite; SpriteStanding: array[TLastDirection] of TSprite; procedure Draw; end; ... procedure TPlayer.Draw; begin if Player.isMoving then SpriteMoving[Player.LastDirection].Draw else SpriteStanding[Player.LastDirection].Draw; end; ... procedure doPress; begin Player.isMoving := true; case Event.Key...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I'm not sure if your approach is wrong, but I'd do it a bit different way. E.g. like this: TLastDirection = (ldRight, ldLeft, ldUp, ldDown); type TPlayer = class (...) SpriteMoving: array[TLastDirection] of TSprite; SpriteStanding: array[TLastDirection] of TSprite; procedure Draw; end; ... procedure TPlayer.Draw; begin if Player.isMoving then SpriteMoving[Player.LastDirection].Draw else SpriteStanding[Player.LastDirection].Draw; end; ... procedure doPress; begin Player.isMoving := true; case Event.Key...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    even when the two rectangles do not touch each other Are you sure the rectangles are correctly intitalized after X/Y is set? Try output WriteLnLog (or just WriteLn) and see console for their values just before the check. You might also be able to do that without log, just by setting a breakpoint around that line and hovering mouse over R.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    What have I done wrong? Do you update R after setting Player.X? E.g. by something like Player.R.Left := Player.X - PlayerSize / 2; Player.R.Bottom := Player.Y - PlayerSize / 2; Player.R.Width := PlayerSize; Player.R.Height := PlayerSize;

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Ugh... I've tried to recover the project (it's about 1.5 years old, so I've completely forgotten what did I do there :)) and it appears to be extremely buggy. Now I recall it was something like that before, as I've never finished it. I've uploaded it to GitLab, but it doesn't seem that there is anything useful there, it should be completely rewritten from a scratch. It'd be much more useful just to follow Michalis' example: https://github.com/castle-engine/castle-engine/blob/master/examples/3d_r...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    P.S. Pay attention, that in the example I'll post here, there is a memory issue. So in order to maintain a stable operation of billboards for trees or similar world objects, you'd be much faster with pre-rendered sprites. E.g. maintaining 400 trees in my example required ~6Gb of RAM. So, this mehtod may be used only for "close forest" FPS optimization. For distant trees you'll need to use identical sprites (to save up memory). As far as I've researched the issue, people say that it's more otpimal...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    P.S. Pay attention, that in the example I'll post here, there is a memory issue. So in order to maintain a stable operation of billboards for trees or similar world objects, you'd be much faster with pre-rendered sprites. E.g. maintaining 400 trees in my example required ~6Gb of RAM. So, this mehtod may be used only for "close forest" FPS optimization. For distant trees you'll need to use identical sprites (to save up memory). As far as I've researched the issue, people say that it's more otpimal...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    @Gabriel, hi! Seems like we're solving the same issue :D I've been trying to do the same forest generation some time ago (thanks to Michalis Kamburelis it really works!), but I didn't finish it yet. I'll search for the latest version of my project and will try to post it today evening - it's not as optimized as it should, but working quiet nice. I'm going to rewrite it soon, but I'm not sure if I'll manage to get to overworld generation (including forest) this year - I already can do that much "cleaner"...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    @Michalis Kamburelis yes, that was the idea I've meant :). @Pete Sergeant I've made a simple working example of Infiminer/Minecraft-style visualization: https://gitlab.com/EugeneLoza/CastleCraft Basically, what you need is RebuildScene procedure https://gitlab.com/EugeneLoza/CastleCraft/blob/master/castlecraft.lpr#L150 which rebuilds the Scene according to the current map state.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    @Michalis Kamburelis yes, that was the idea I've meant. @Pete Sergeant I've made a simple working example of Infiminer/Minecraft-style visualization: https://gitlab.com/EugeneLoza/CastleCraft Basically, what you need is RebuildScene procedure https://gitlab.com/EugeneLoza/CastleCraft/blob/master/castlecraft.lpr#L150 which rebuilds the Scene according to the current map state.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi, Pete! I think it significantly depends on what final goal you are trying to achieve. If you need only to make a small trench "simple and dirty" solution would be to use TBoxNodes wrapped inside TSwitchNodes and by setting TSwitchNode.WhichChoice to 0 or to 1 you can turn off/on visibility of the TBoxNode. However, if you're trying to make something like Minecraft with hundreds of thousands of minable blocks you need to make a bit different approach and construct a separate procedural mesh for...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I think you may implement it this way: CastleControl1.SceneManager.Camera.SetView(MyScene.BoundingBox.Middle + Vector3(0, 0, MyScene.BoundingBox.MaxSize + 1), Vector3(0, 0, -1), Vector3(0, 1, 0)); CastleControl1.SceneManager.Camera.Input := TCamera.DefaultInput; CastleControl1 . Update; where MyScene.BoundingBox.Middle + Vector3(0, 0, MyScene.BoundingBox.MaxSize + 1) is location of the camera (it's MyScene.BoundingBox.MaxSize + 1 away from MyScene.BoundingBox.Middle by Z-axis), you'll need to change...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Save3d(CastleControl1.SceneManager.MainScene.RootNode, CastleSaveDialog1.URL); does not seem to work Hmmm... strange, it should work. Does CastleSaveDialog1.URL contain a valid value? Is there some feedback from the loading/saving procedure to assign to a progressbar (or something similar) Try this one: https://castle-engine.io/apidoc/html/CastleProgress.TProgress.html and its output may be routed to https://castle-engine.io/apidoc/html/CastleControls.TCastleProgressBar.html

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    The simplest way to do this is to use TSwitchNodes: var Root: TX3DRootNode; Scene: TCastleScene; Models: array[0..5] of TSwitchNode; procedure LoadModelsAndBuildScene; begin Root := TX3DRootNode.Create; for i := 0 to 5 do begin Models[i] := TSwitchNode.Create.FdChildren.Add(Load3D(SomeModelURL[i])); Models[i].WhichChoice := 0; Root.Children.Add(Models[i]); end; Scene := TCastleScene.Create; Scene.Load(Root); CastleControl1.SceneManager.Add(Scene); CastleControl1.SceneManager.MainScene := Scene; end;...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    The simplest way to do this is to use TSwitchNodes: var Root: TX3DRootNode; Scene: TCastleScene; Models: array[0..5] of TSwitchNode; procedure LoadModelsAndBuildScene; begin Root := TX3DRootNode.Create; for i := 0 to 5 do begin Models[i] := TSwitchNode.Create.FdChildren.Add(Load3D(SomeModelURL[i])); Models[i].WhichChoice := 0; Root.Children.Add(Models[i]); end; Scene := TCastleScene.Create; Scene.Load(Root); CastleControl1.SceneManager.Add(Scene); CastleControl1.SceneManager.MainScene := Scene; end;...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    When loading million lines this may take a while. In such cases I usually do if I mod 1000 = 0 then Application.ProcessMessages so that the Form won't be updated too often (e.g. million of times each of which may take a few milliseconds up to several minutes total). But if I open the x3d I don't see anything I've never rendered separate TCoordinateNodes before, so I'm not exactly sure how to fix the issue. I think there should be some sort of rendering parameter to render the points (not only solid...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    If I understand your question correctly Temp2 contains the coordinates of vertexes, right? Then it's almost the same way: MyVector3List := TVector3List.Create; for I := 1 to Temp1.Count - 1 do begin Application.ProcessMessages; //<--- I'm not sure about this line, do you really need to ProcessMessages that often? That'll be a major slowdown. Temp2.CommaText := Temp1[I]; StringGrid1.Cells[0,I] := IntToStr(I); StringGrid1.Cells[1,I] := Temp2[0]; StringGrid1.Cells[2,I] := Temp2[1]; StringGrid1.Cells[3,I]...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi! I think the best variant is to use https://castle-engine.io/apidoc/html/X3DNodes.TSphereNode.html for the purpose. Depending on the situation you may also try using a rectangular box https://castle-engine.io/apidoc/html/X3DNodes.TBoxNode.html which would run a bit faster due to lower amount of tris.

  • EugeneLoza EugeneLoza modified a comment on ticket #631

    Yep, confirming and supporting the issue. The spam we were getting lately is 100% covered by 3 categories: drugs, weight loss and online casino and could have been automatically filtered by a few corresponding keywords.

  • EugeneLoza EugeneLoza modified a comment on ticket #631

    Yep, confirming and supporting the issue. The last spam we were getting lately is 100% covered by 3 categories: drugs, weight loss and online casino and could have been automatically filtered by a few corresponding keywords.

  • EugeneLoza EugeneLoza posted a comment on ticket #631

    Yep, confirming and supporting the issue. The last spam we were getting is 100% covered by 3 categories: drugs, weight loss and online casino and could have been automatically filtered by a few corresponding keywords.

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    ir_dereference_variable That looks like a MESA-related issue. Do you have all the required libraries (MESA OpenGL driver first of all) + dev versions installed? This list works for me: libopenal1 libopenal-dev libpng16-16 libpng-dev zlib1g zlib1g-dev libvorbis0a libvorbis-dev libfreetype6 libfreetype6-dev libgtkglext1 libgtkglext1-dev libgl1-mesa-dev /// <----- that's the one I suspect missing

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    ir_dereference_variable That looks like a MESA-related issue. Do you have all the required libraries (MESA OpenGL driver first of all) + dev versions installed? This list works for me: libopenal1 libopenal-dev libpng16-16 libpng-dev zlib1g zlib1g-dev libvorbis0a libvorbis-dev libfreetype6 libfreetype6-dev libgtkglext1 libgtkglext1-dev libgl1-mesa-dev /// <----- that's the one I'm suspecting missing

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    The simplest way to clear the screen is uses ... CastleColors, CastleGLUtils; ... procedure TForm1.Castle2DControl1Render(Sender: TObject); begin RenderContext.Clear([cbColor], Black); //<---------- this will clear the 2DControl to "Black" color //(draw something) end; You may also specify the custom color to clear the screen, just use RenderContext.Clear([cbColor], Vector4(1,0.5,0,1)); for orange color (also replace CastleColors with CastleVectors in your "uses" section)

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi, smo! You can easily generate or modify the model by code. See these examples: https://github.com/eugeneloza/castle-engine/blob/master/examples/3d_rendering_processing/build_3d_object_by_code.lpr https://github.com/eugeneloza/castle-engine/blob/master/examples/3d_rendering_processing/build_3d_tunnel.lpr

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot! Now I have a food for thought :) About "huge" - it's huge corresponding to a "normal" location size (~100-300 thousands tris). E.g. 10x10 km, maybe 20x20km (3 hours of walking in real-life), so pricision is not a serious issue here. But creating a real horizon would actually make a ~10-story building go behind the horizon - this is mostly the only thing I'm trying to solve this way :), to be more precise: 3m drop for 10km, 21m drop for 20 km, 55m drop for 30km (larger valules for "farland")....

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Hi, Michalis! This is not anywhere near "haste" topic. But I'd be very thankful for your comments on the issue. The idea is: When I'll come to implementation of Overworld I have an idea to put it on a surface of a spherical world. I.e. we have a planet and a huge Overworld over its surface. We have a Sun and other planets which position is calculated to generate sky map, day-and-night cycle, etc. Maybe, even some dynamic weather system to allow for sky generation and gradual meteorologic conditions...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Hi, Michalis! This is not anywhere near "haste" topic. But I'd be very thankful for your comments on the issue. The idea is: When I'll come to implementation of Overworld I have an idea to put it on a surface of a spherical world. I.e. we have a planet and a huge Overworld over its surface. We have a Sun and other planets which position is calculated to generate sky map, day-and-night cycle, etc. Maybe, even some dynamic weather system to allow for sky generation and gradual meteorologic conditions...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Hi, Michalis! This is not anywhere near "haste" topic. But I'd be very thankful for your comments on the issue. The idea is: When I'll come to implementation of Overworld I have an idea to put it on a surface of a spherical world. I.e. we have a planet and a huge Overworld over its surface. We have a Sun and other planets which position is calculated to generate sky map, day-and-night cycle, etc. Maybe, even some dynamic weather system to allow for sky generation and gradual meteorologic conditions...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi, Michalis! This is not anywhere near "haste" topic. But I'd be very thankful for your comments on the issue. The idea is: When I'll come to implementation of Overworld I have an idea to put it on a surface of a spherical world. I.e. we have a planet and a huge Overworld over its surface. We have a Sun and other planets which position is calculated to generate sky map, day-and-night cycle, etc. Maybe, even some dynamic weather system to allow for sky generation and gradual meteorologic conditions...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Yes, I understand that. As I've written somewhere, I've already had some critical crash back some days with damaging of a HDD filesystem :)

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot! Yes, that's exactly the reason I'm trying to dive into threads, and yes, I'm issuing as much locks as possible to prevent any global data (except for animated loadscren) simultaneous access. And the issue is that it works for me (e.g. loading TScenes for tiles in a thread works fine, but not calling TScene.Prepare which fails badly :)). So my logic was to move at least HDD access on TSCene.Load into a thread. That said, when I'll return to Overworld I'll have to load and unload models...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Is it possible to publish T3DResourceAnimation.FSceneForAnimation (e.g. to Protected level)? Or make a procedure to load it manually? Looks like preforming FSceneForAnimation := TCastleScene.Create(nil); FSceneForAnimation.Load(URL); (which looks thread-safe to me) may improve loading speed by 30-40% (still can't move everything to a thread, but at least the delay will be a bit shorter). (I'm still struggling with choosing the best way to load and display animated 3D models :))

  • EugeneLoza EugeneLoza posted a comment on discussion Vote

    VOTE: lazarus

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Ahhh... I just didn't change the password.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi, Michalis! Is it possible for SoundEngine.PlaySound to start/loop not from the very beginning of the sound buffer, but in a managed way (from a certain time)? Or manage the current playing position (in time, not in space) in CastleSoundAllocator.TSound?

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    UPD: Yes, "prepare" isn't working in a thread :) Hmm... I should think of something. I wonder if its caused by using OpenGl features in TCastleScene.PrepareResources? Theoretically it seems that loading the data (slow and thread-safe) and pre-rendering (quick and not thread-safe) may be separated.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot! It's working perfectly! :)

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Hi, Michalis! I'm working with adding creatures, but CreatureResource.CreateCreature "interrupts" the world loading. As far as I've understood, the first time I call CreatureResource.CreateCreature it makes some initialization routines (~2 seconds for a knight creature). 04:52:55> Resources: Resource "Knight" becomes used, preparing 04:52:57> Resources: Loading resources time: 2.48 seconds Is there a way to pre-initialize the creature without actually adding it? Before it "became used"? I.e. I have...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot! I'll see what I can do here...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Geometry instancing I'm still thinking on the overworld generation. I've found a method called Geometry Instancing in OpenGL tutorial which obviously should preform much better for trees, rocks, grass, etc than my current approach. However, I've found no instancing in the Engine documentation, right? I'm still far from being ready to implement it, but it looks like a nice addition. Or did I just miss it and it is already available? I might try to work on it (according to the OpenGL tutorial), however,...

  • EugeneLoza EugeneLoza posted a comment on discussion Vote

    VOTE: freepascal with me both in my work and in my spare time :)

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot! (And finally I can login again :)) Maybe, then I'll have a go with...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Thanks a lot again! After installing a Debian package everything works. I'm using...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    A little more about documentation. I found ISO/IEC 19775-1, Extensible 3D (X3D) to...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot again! After installing a Debian package everything works. I'm using...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Ooops... My bad as usually :) I was absolutely sure I always ran executables this...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    E.g. size 1024 x 256 is not a problem. And which is the smallest texture size? Is...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    P.S. No need to analyze my code now, I'm still working on it (actually, the new version...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    P.S. No need to analyze my code, I'm still working on it (actually, the new version...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot for the answer! I'll try to analyze it asap :)

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I decided that having BlendingSort=bs3D by default is a good idea:) I've exactly...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot! I've finally studied TCollisionNode specifications... WOW, that's one...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I've downloaded a debian package from repository, and I'll try it today evening.

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I've downloaded pasdoc-0.14.0-linux-x86_64.tar.gz file, so it should be 64 bits....

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Thanks a lot! That should be it :)

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    Not done yet, but working on it :) On memory issue: looks like TCastleScene.spatial...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Not done yet :) On memory issue: looks like TCastleScene.spatial := [ssRendering,...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I.e. there is no z-sorting. The TX3DRootNodes that were added first are drawn first...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    I've come up with a wierd z-sorting problem for a very simple scene... When I look...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I've come up with a wierd z-sorting problem for a very simple scene... When I look...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    I'm having an issue with collisions. I.e. I don't need collisions for tree branches...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Started rewriting the program to check where the memory fails :) Plus optimize the...

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    Another thing to consider: I'm using TCastleScene.exitst to show and hide sprites/3D....

  • EugeneLoza EugeneLoza posted a comment on discussion General Discussion

    It can happen like some "links" I store are actually copies of the objects with complete...

  • EugeneLoza EugeneLoza modified a comment on discussion General Discussion

    We had holidays :) So I had time to investigate rendering 3d object to texture. There...

1 >