Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - nabz32

#31
I wish you all a happy and productive year too  :good:
:booze:
#32
The project runs without problems in debug mode,
but when I compile it in normal mode there is only a black screen with nothing happening ( esc key won´t work for quitting anymore ).

After commenting out some lines, i found the reason for this behaviour is the PLAYMUSIC command.
In debug mode the music plays, but in normal compile mode the application hangs when calling PLAYMUSIC.
This is only happening when using my Lenovo Laptop. Very strange.
Are there some differences in how GLBasic will handle the PLAYMUSIC command when in debug mode compared to normal compile mode?

Edit: I used the playmusic command with mp3 files in this case.   
#33
Yes i have some inline code for light attenuation in my code:

Code (glbasic) Select
INLINE
    }; //namespace zumachen
        // Funktion definieren
    extern "C"{
    void __stdcall glLightf(int, int, float);
    void __stdcall glEnable( int );
    void __stdcall glDisable( int );
    }

        // Globale Konstanten
        #define GL_LIGHTING 0xB50
    #define GL_LIGHT0 0x4000
    #define GL_CONSTANT_ATTENUATION 0x1207
    #define GL_LINEAR_ATTENUATION 0x1208
    #define GL_QUADRATIC_ATTENUATION 0x1209
        // Namespace aufmachen
    namespace __GLBASIC__ {

ENDINLINE

FUNCTION glLightAttenuation: iLight%, konstant# , linear#, quadratic#
INLINE
    glLightf(GL_LIGHT0+iLight , GL_CONSTANT_ATTENUATION,  konstant );
    glLightf(GL_LIGHT0+iLight , GL_LINEAR_ATTENUATION, linear);
    glLightf(GL_LIGHT0+iLight , GL_QUADRATIC_ATTENUATION, quadratic);
ENDINLINE
ENDFUNCTION

FUNCTION switchAllLights: on%
INLINE
    if( on == true ) glEnable(GL_LIGHTING) ;
    else glDisable(GL_LIGHTING);
ENDINLINE
ENDFUNCTION


The memory usage of my project is roughly only at 64 mB when using low resolution textures.
I still have the preinstalled lenovo modified win7 on my laptop.
I´ll turn off all the special lenovo software and try it again.
#34
Hi, I  recently compiled my game on a new laptop and the game crashes after compile
and won´t close unless I kill it using the task manager.

Tried to run it in debug mode and it crashes if no break points are set,
however if I set some breakpoints during the initialisation process the game starts up correctly,
however I get a random c0000005 crash somewhere during gameplay all the time.

I used a lenovo think pad T430 with an intel HD 4000 graphic chip for testing.
Could this be hardware related?
#35
And here it is with all my concerns removed:



I will post something in the Bonus section, when I have created 3D meshes out of this data :)
Edit: Thanks again, also a special thanks to Slydog with his picture of the subdivided triangle, now I know how to subdivide the triangles for my needs later on. :good:
#36
I sorted all branches based on their angle to the center,
so lines of branches only check for intersection with branches next to them.

Also I rewrote the code so that any number of branches are possible from one point:


Now I need to fill the void spaces, preferable with objects of a triangle class which can be subdivided.
When there are three cut points one single triangle object will be created,
if there are four cut points two triangles.

Should there be more than 4 intersections and the number of intersections is even,
I could give each branchpair a triangle based on the intersection points the lines of the branch pair have ( should always be three with my algorythm ).
Then repeat this with the intersection of the lines of the new added triangles until the number of freshly created triangles equals three.
After this I just have to fit one last triangle in the remaining space.

But what to do if it is an uneven number of branches?

Edit: I have just noticed that i can simply fill all void spaces with more than 3 edges by using an additional vertex in the center of the intersection
( like someone would close a cylinders top ).
Edit2: Here is how it looks without subdivided triangle objects yet:

#37
Yeah I know the sides of the filling objects equals the number of intersections if the intersections are greater then 2.
I have trouble calculating the cut points right:
I have calculated the cutting points of the red outer lines which I called rows, however this works only on some occasions, like the one you showed in your screenshot slydog. The reason is the red lines are not always cutting each other.
Here it works:


I could also check for the intersection point of the green outer Lines ( collums ), but I think they only need to be taken into account if 2 rows don´t intersect.
Also in this case a smaller triangle than usual would be created, since 4 points are determined by the intersection of rows and 2 points are determined by the collum intersection, which basically is just the point all branches originally have met without interpolation.

I rewrite my code a bit to sort out the last errors.

Edit: thanks to you guys for your suggestions.

Edit2: Well filling with a second polygon is needed if only 2 set of lines intersect:




#38
Hello, I wanted to create a new world engine, where the whole world is build out of paths.

I give each path point a certain thickness, so an actual area is created from branch to branch with a certain width
( the length of the area is the distance between two points of the path ),
like this:



In this shot each father point has only one son, so the points can easily be interpolated.

If a father has two sons, i need to put some sort of triangle between the tree, to make a nice transition between those.
How to calculate this triangle out of the 3 branches, so that none of these branches overlap each other?

Here is how it looks with 2 sons without interpolation or a triangular spacer between the 3:


( subdivision is also different between the 2 pics in case you wonder )



#39
Did you use the shoebox to hides your Media files for stream,
Or is it enough to have an uncompressed Media dieectory?
#40
There are no noticable performance issues with this,
at least while trying it with the PC version.

Here is the code if anyone is interested how to do this in detail:

Code (glbasic) Select

INLINE
    };  // close GLBasic namespace

    extern "C"{
    void __stdcall glEnable( int );
    void __stdcall glDisable( int );
    }
        #define GL_LIGHTING 0xB50  // <- this took me long to find (-;
    namespace __GLBASIC__ {         // open GLBasic namespace

ENDINLINE

FUNCTION switchAllLights: on%
INLINE
    if( on == true ) glEnable(GL_LIGHTING) ;
    else glDisable(GL_LIGHTING);
ENDINLINE
ENDFUNCTION


#41
Glbasic wants an angle for sin and Cos functions dont know if it Works with Radians too
#42
Announcements / Re: Update
2016-Aug-20
indeed faster compile speed thank you very much for the update Kitty :good:
#43
Ja behoben, danke der nachfrage. Hatte auch erst das 64 bit sdk verwendet, mit dem 32er hat das besser geklappt.
#44
I added touch screen controls to the game, this way I finally got past the intro for testing on my Android device :)
The game runs smooth ( didn´t record framerate yet, but it didn´t seem to stutter even in areas with more lights ).

Playing this on an OLED screen with high contrast really improves on the game experience :)

#45
Dont know if this will help.
Maybe try it with an absolute path in the killfile command instand of setcurrentdir.