User Profile

Collapse

Profile Sidebar

Collapse
Xillez
Xillez
Last Activity: Jun 13 '24, 01:48 PM
Joined: Jul 4 '13
Location: no where
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Xillez
    started a topic Three.js lighting problem

    Three.js lighting problem

    Hello! I'm trying to set up a scene in THREE.js using some different lighting sources, but the "floor" only reacts to AmbientLight (removed in three.js scene) and should be lit about the same as in the blender view. I've verified the normals on the model point outwards and the material has default blender material settings as THREE.MeshLambe rtMaterial.

    Light settings:
    Code:
    const spotLight = new THREE.SpotLight('#ffffff');
    ...
    See more | Go to post

  • Xillez
    replied to Wierd shadows on boxes, three.js
    Old question, ignore
    See more | Go to post

    Leave a comment:


  • Xillez
    started a topic Wierd shadows on boxes, three.js

    Wierd shadows on boxes, three.js

    Hello! I've added shadowMapping in three.js (typescript) and get these weird shadows. Any ideas on how to smooth them out?

    Currently using "shadowMap. type = THREE.PCFShadow Map", and "THREE.PCFSoftS hadowMap" isn't any better.
    See more | Go to post

  • Easy accesses to members higher up in object hierarchy

    Language is TypeScript (didn't have a specific category).
    Say I have a object hierarchy like so:

    Code:
    let obj = {
      instance_id: "<some uuid>"
      child1:
      {
        child2:
        {
          function log() => console.log(instance_id);
        }
      }
    }
    Is there some clever way of allowing "instance_i d" to be accessible to the...
    See more | Go to post

  • Xillez
    started a topic Which is better?
    in Java

    Which is better?

    Hey again!

    I've made 2 separate systems, an ECS and a Collision detection system for a game. I want an event handling system for handling the communication between components and game management systems (collision detection, ECS and so on). After a bit of prototyping and thinking I've come to two separate ways I can handle this and I'm just curious as of which of these (or possibly any other way) is better.

    1. I can...
    See more | Go to post

  • Xillez
    started a topic CMAKE Windows program prints nothing
    in C

    CMAKE Windows program prints nothing

    Hey, I've had an project on Linux, but I wanna also be able to work on windows, now the CMakeLists.txt file apparently can make the makefile using MinGW or Cygwin's g++. Once the program is built with mingw32-make or cygwin's make command and ran, it does nothing.

    Running in GDB it states "(gdb) During startup program exited with code 0xc0000139.", Do anyone know what this means? No very useful info found so far.
    ...
    See more | Go to post
    Last edited by Xillez; Dec 19 '18, 02:15 PM. Reason: Added GDB print

  • Xillez
    replied to 2d class member list of objects not updating
    Solved it by making the "self." variables in Map global using the "global" key word (and removing the "self." of course). It might not be a good thing, but it works
    See more | Go to post

    Leave a comment:


  • Xillez
    replied to 2d class member list of objects not updating
    Appreciate the answer but...

    I tried printing with self.tiles[y][0][0] with and without .type and it says "Tile object does not support indexing". The [][][] tries to fetch the a position within a 3d list, but since [[] * width] * height makes a 2d list this is understandable, so the object lies in the inner list.

    As far as I understand the code should be correct (coming from a c++/java programming background,...
    See more | Go to post

    Leave a comment:


  • Xillez
    started a topic 2d class member list of objects not updating

    2d class member list of objects not updating

    I have a problem updating self.tiles[][].type in line 29. Once leaving the for loops in Map's __init__, the tiles list "forgets" the update somehow.

    - I've tried adding a setter function for "type" in Tile but that didn't work also tried making the "type" a class level variable but that didn't and wouldn't help anyway.
    - I don't suspect its something to do with reference since I'm only working...
    See more | Go to post

  • OK, I got it running by doing the first point in this thread: https://stackoverflow.com/a/10632266

    I moved the function implementation into the header.

    Thanks btw weaknessforcats :-)
    See more | Go to post

    Leave a comment:


  • Not really concerned, but it seems as if multiple linked files is the problem. Not really sure why it should be a problem at all though.

    As I build the program the cmake compiler tells me what it finished and how many percent is compiled so far, and the Entity class is built before EntityMgr class (so it's available). The EntityMgr.cpp gets it's Entity type from the EntityMgr.hpp file. The main.cpp file knows about it from EntityMgr.hpp....
    See more | Go to post

    Leave a comment:


  • In fact the file attached compiles even with cmake, so it's a problem with multiple files then. Any clue on how I can compile it with multiple files?
    See more | Go to post

    Leave a comment:


  • I've managed to compile it in a single file (in zip), using the g++ compiler. It seems to be cmake's compiler...

    The file is simplified and built by exchanging includes, with file content with a little cleanup
    See more | Go to post

    Leave a comment:


  • What compiler are you using? I use cmake (default setup with Ubuntu 17.10)

    See if you can compile my project?
    See more | Go to post

    Leave a comment:


  • Sorry for late reply.

    I tried implementing one of you're solutions, but still have the same problem.

    Error:
    CMakeFiles/Framework.dir/source/src/main.cpp.o: In function `main':
    main.cpp:(.text +0x33): undefined reference to `void A::createEntity <E>()'

    Could it be that when the functions are generated at compile-time, it doesn't know about class B yet (aka hasn't beed defined), then...
    See more | Go to post

    Leave a comment:


  • Not exactly, but I appreciate the effort :-)

    I think you missed the part with "stores it internally". The thing is that the new object should not be sent out, but stored inside.

    A thing I forgot to mention: the return of the createObject function is the id (or game-id) of the new object (so returning 0 inside is fine).

    The main difference is that the template class is used as the return type of the...
    See more | Go to post

    Leave a comment:


  • Make templated member function instantiate object of given class type

    Say I have two classes A and B. I want A to have a templated function "makeObject ()", which makes a new object of the given class template-type and stores it internally.

    Is the below correct?
    Code:
    A a;
    a.createObject<B>();
    Classes + Functions:
    Code:
    class A
    {
        template<typename Tclass>
        unsigned int createObject();
    }
    
    template<typename
    ...
    See more | Go to post
    Last edited by zmbd; Aug 11 '18, 03:26 PM. Reason: [z{fixed your title :) }]

  • Xillez
    started a topic Template Member function undfined
    in C

    Template Member function undfined

    I have a problem with undefined templated member function used in main.

    Error:
    "CMakeFiles/Framework.dir/source/src/main.cpp.o: In function `main':
    main.cpp:(.text +0x33): undefined reference to `unsigned int EntityMgr::crea teEntity<Entity >()'"

    Can someone please help me understand why the EntityMgr::crea teEntity function is undefined from main?

    Current setup (simplified):
    ...
    See more | Go to post

  • Xillez
    replied to Modern (SDL2) OpenGl 3.3 Not Drawing
    in C
    I kind of fixed it. It was the "Depth_Buff er", "Depth_Test " and "GL_Cull_Fa ce" that messed it up. OpenGL is testing each pixels z-value in the depth buffer, but I haven't assigned a depth buffer to be used other than saying OpenGl will get 16+ bits to store depth information per pixel, so OpenGl doesn't draw. Plus that I reverted "Mesh.h + Mesh.cpp" to take everything it needs and initializes immediately,...
    See more | Go to post

    Leave a comment:


  • Xillez
    replied to Modern (SDL2) OpenGl 3.3 Not Drawing
    in C
    No, the reason is that I can add a unknown number of vertices in a mesh and once the mesh initializes, OpenGL takes all those vertices at once and dumps them in a buffer for drawing. That's why it's Create, Modify and then Init :-) (I do understand that it looks a little weird) Plus it cuts down on the amount of array's of vertices I would need to have everywhere and it makes the code a little more cleaner I think :-)
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...