And know C++. Which is, IMO, a more limiting problem.
Printable View
And know C++. Which is, IMO, a more limiting problem.
You don't need to know C++ so much as you need to be able to understand the math of 3D space.
You have many examples of effects right there to look at, copy and modify.
It is C++ but it's pretty deep into LaserBoy classes and all those overloaded operators! :)
But you do need to know how to install and use a free compiler.
Once you get the whole thing compiled, you only need to re-compile and link the cpp files that you edit.
You know that! You work with Java! Not too different.
If there is an effect that you like and you want to know more about it, let me know.
I'll post the code for it here in this thread and go over it line by line as to what it does.
I tried but failed. Using Dev-C++ 4.9.9.2
I just opened LaserBoy.dev and hit Compile. Are there any other steps required?Code:Compiler: Default compiler
Bezig met uitvoeren van make...
make.exe -f "Makefile.win" all
g++.exe -c LaserBoy.cpp -o ../src/LaserBoy.o -O3 -fexpensive-optimizations -Wall -Dmain=SDL_main -mwindows -D_WIN32_WINNT=0x0501 -static
In file included from LaserBoy_macros.hpp:34,
from LaserBoy_common.hpp:34,
from LaserBoy_bmp.hpp:33,
from LaserBoy_segment.hpp:34,
from LaserBoy_frame.hpp:34,
from LaserBoy_frame_set.hpp:34,
from LaserBoy_space.hpp:34,
from LaserBoy_TUI.hpp:33,
from LaserBoy_GUI_base.hpp:33,
from LaserBoy_SDL_GUI.hpp:34,
from LaserBoy.cpp:30:
LaserBoy_includes.hpp:62:32: boost/filesystem.hpp: No such file or directory
LaserBoy_includes.hpp:63:38: boost/algorithm/string.hpp: No such file or directory
In file included from LaserBoy_macros.hpp:34,
from LaserBoy_common.hpp:34,
from LaserBoy_bmp.hpp:33,
from LaserBoy_segment.hpp:34,
from LaserBoy_frame.hpp:34,
from LaserBoy_frame_set.hpp:34,
from LaserBoy_space.hpp:34,
from LaserBoy_TUI.hpp:33,
from LaserBoy_GUI_base.hpp:33,
from LaserBoy_SDL_GUI.hpp:34,
from LaserBoy.cpp:30:
LaserBoy_includes.hpp:65: error: `boost' has not been declared
LaserBoy_includes.hpp:65: error: expected namespace-name before ';' token
LaserBoy_includes.hpp:65: error: `<type error>' is not a namespace
LaserBoy_includes.hpp:66: error: `boost' has not been declared
LaserBoy_includes.hpp:66: error: expected namespace-name before ';' token
LaserBoy_includes.hpp:66: error: `<type error>' is not a namespace
In file included from LaserBoy_GUI_base.hpp:33,
from LaserBoy_SDL_GUI.hpp:34,
from LaserBoy.cpp:30:
LaserBoy_TUI.hpp:141: error: `directory_entry' was not declared in this scope
LaserBoy_TUI.hpp:141: error: template argument 1 is invalid
LaserBoy_TUI.hpp:141: error: template argument 2 is invalid
LaserBoy_TUI.hpp:141: error: ISO C++ forbids declaration of `working_directory_list' with no type
In file included from LaserBoy.cpp:30:
LaserBoy_SDL_GUI.hpp:35:21: SDL/SDL.h: No such file or directory
In file included from LaserBoy.cpp:30:
LaserBoy_SDL_GUI.hpp:120: error: variable or field `check_for_common_nav_keys' declared void
LaserBoy_SDL_GUI.hpp:120: error: expected `;' before '(' token
LaserBoy_SDL_GUI.hpp:206: error: `SDL_Event' does not name a type
LaserBoy_SDL_GUI.hpp: In member function `virtual void LaserBoy_SDL_GUI::display_state(const std::string&)':
LaserBoy_SDL_GUI.hpp:66: error: invalid use of undefined type `struct SDL_Surface'
LaserBoy_SDL_GUI.hpp:39: error: forward declaration of `struct SDL_Surface'
LaserBoy_SDL_GUI.hpp:70: error: `SDL_UnlockSurface' undeclared (first use this function)
LaserBoy_SDL_GUI.hpp:70: error: (Each undeclared identifier is reported only once for each function it appears in.)
LaserBoy_SDL_GUI.hpp:71: error: `SDL_UpdateRect' undeclared (first use this function)
LaserBoy_SDL_GUI.hpp:72: error: `SDL_LockSurface' undeclared (first use this function)
LaserBoy_SDL_GUI.hpp: In member function `virtual void LaserBoy_SDL_GUI::display_progress(int)':
LaserBoy_SDL_GUI.hpp:85: error: invalid use of undefined type `struct SDL_Surface'
LaserBoy_SDL_GUI.hpp:39: error: forward declaration of `struct SDL_Surface'
LaserBoy_SDL_GUI.hpp:89: error: `SDL_UnlockSurface' undeclared (first use this function)
LaserBoy_SDL_GUI.hpp:90: error: `SDL_UpdateRect' undeclared (first use this function)
LaserBoy_SDL_GUI.hpp:91: error: `SDL_LockSurface' undeclared (first use this function)
make.exe: *** [../src/LaserBoy.o] Error 1
Uitvoering voltooid
PS. I fixed the effects that crashed. Bummer. I should have tested every one of them before I released it.Code://############################################################################
LaserBoy is compiled for Windows with:
MinGW with GCC 4.7.2
http://www.mingw.org/
libSDL version 1.2.15.0
http://www.libsdl.org/
boost C++ version 1.53.0
http://www.boost.org/
using Dev-C++ dev environment
http://www.bloodshed.net/devcpp.html
//############################################################################
James.
I fixed those effects in this version.
http://laserboy.org/code/LaserBoy_2014_12_24.zip
Please let me know if you find anything else!
James.
I just got back from visiting my nephews in Columbus, Ohio. They are both really into programming. The younger one has a really nice Mac Book. So I had an opportunity to compile and run LB on a Mac and see it in person.
I found that when I tried to optimize the frames it crashed.
So I looked into it a bit and found that I was setting an int to a macro value:
points_away = LONG_MAX;
This is in LaserBoy_segment.cpp in the function shortest_path_of_segments.
I don't know why it would be different on a Mac, but it didn't work.
So I changed the declaration type of points_away from int to long int and it works now.
I will be releasing it again soon, but I thought I should make a public note of this in case anyone was trying to compile it for Mac.
If anyone else has any issues that they have found please let me know!
James.
New version:
http://laserboy.org/code/LaserBoy_2015_01_04.zip
This fixes the Mac OSX long int issue and also the lava and lava2 frame set effects.
James.
Goofing around with frame effects again....
This is really cool! definitely going in the next release, hopefully with some more new ones!Code:LaserBoy_Bounds twist(LaserBoy_frame* p_frame)
{
int i, j;
LaserBoy_Bounds out_of_bounds;
LaserBoy_3D_double rotated_coordinate;
LaserBoy_frame frame(p_frame->p_space);
LaserBoy_frame_set out(p_frame->p_space);
//------------------------------------------------------------------------
frame = *p_frame;
out += frame;
for(i = 0; i < 400; i++)
{
for(j = 0; j < (int)frame.size(); j++)
if(frame.at(j).x <= (short)((i * 163.84) - 32767.0))
{
rotated_coordinate = rotate_vertex_around_x(frame.at(j), pi/200.0);
out_of_bounds = LaserBoy_bounds_check(rotated_coordinate, LASERBOY_CUBE);
if(out_of_bounds)
return out_of_bounds;
else
frame.at(j) = rotated_coordinate;
}
out += frame;
}
for(i = 0; i < 400; i++)
{
for(j = 0; j < (int)frame.size(); j++)
if(frame.at(j).x >= (short)((i * 163.84) - 32767.0))
{
rotated_coordinate = rotate_vertex_around_x(frame.at(j), pi/200.0);
out_of_bounds = LaserBoy_bounds_check(rotated_coordinate, LASERBOY_CUBE);
if(out_of_bounds)
return out_of_bounds;
else
frame.at(j) = rotated_coordinate;
}
out += frame;
}
out.save_as_ild(LASERBOY_ILD_SHARE + "twist.ild");
return LASERBOY_IN_BOUNDS;
}
Duh!
I just realized I have to re-write the whole system of calling effects to return LaserBoy_Bounds checks!
Working on that now.
I guess I'll be releasing it again very soon.
Look what I just made! :)
I figured out cylinder, half cylinder, sphere and hemisphere wrapping.
Then I got a DXF true cylinder projection of the Earth and wrapped it around a hemisphere.
There are a lot of points, but it looks really cool.
I'm going to work on some more aggressive points reduction ideas next.
James.
I have one bug report and one suggestion :)
I like the update checking, but just the other day I started LaserBoy while my internet was down, and it freeze crashed. I simply couldn't use it until my internet was back..
And it would be cool to have quick command line functions or an API. Could for example be used for bulk optimizing or converting of files via bash or batch scripting instead of doing each one manually inside the program :)