-
Posts
4,127 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Canardia
-
Reply #5 explains it very well: Using vector, you only create elements which actually exist. There is no need to have a list of things which don't even exist. You can pass a reference to models (of type vector<Model>) to any function, and it will know it is a list of objects. If it's empty, that's fine, if it has content, that's OK too, but I don't want to get a list with empty elements. Again, it's not needed at all to have a list of references, since it would mean that you have the memory for the references somewhere else (also in a list). But vector IS the actual memory, so you can say: #include <string> #include <vector> using namespace std; class Model { string name; public: virtual void SetName(const string& name) { this->name=name; } virtual const string& GetName(void) const { return name; } }; void populate(vector<Model> &models) { Model m; m.SetName("Ferrari"); models.push_back(m); m.SetName("Lamborghini"); models.push_back(m); } void print(vector<Model> &models) { vector<Model>::iterator models_it; int i=0; for( models_it=models.begin(); models_it!=models.end(); models_it++ ) { printf("Model %d: %s\n", ++i, (*models_it).GetName().c_str() ); } } int main(void) { vector<Model> models; populate(models); print(models); } Now your vector contains two models, and you don't have to care what memory they use, the vector has it. The temporary m object is then destroyed after the populate() function ends, so you don't have to care about its memory either.
-
Baked AO, ambient occlusion
Canardia commented on Flexman's blog entry in CombatHelo Blog (RSS Import)
Yeah, baked AO is the way to go with vertex engines. It takes too much FPS to do as good quality AO with shaders. The FPS can be used for much more important stuff which you can't bake, like raytracing, or at least light bounce and color bleed. -
Of course you can, and it's much faster than making manually a list with pointers: vector<Model> models; Some guy measured that for example the .Sort() method of a vector is about 25 times faster than QuickSort. It uses different sort algorithms and chooses the fastest depending on the data structure.
-
They are own classes: class Rotation:public Vec3{}; Maybe it would work also as typedef, if C++ can distinguish Rotation from Vec3 in polymorph class methods: typedef Vec3 Rotation;
-
I've not experienced that, but if it happens to someone, it might be that you are running the C++ in debug mode with the debug define enabled, which will use the debug.dll, which is very very very slow. Also without the debug.dll the C++ debug mode can be slower than BlitzMax in release mode. If your C++ is slower in release mode, then it might be that the slowness of blitzmax comes with the dll, and since there are more blitzmax commands in the dll than in the blitzmax version, then C++ has to process more slow code. When the dll is made in C++, there will be fast code inside, and the dll code will be also fast. So BlitzMax will be faster with LE3 than it is now, and C++ will be also faster than BlitzMax.
-
The problem with pointers is that you can't use "." to seperate methods, but you need to use that ugly "->". In addition with references you can't have NULL pointers or pointers which point to a sensitive location which will crash the program and could even destroy your whole computer, so it's also more safe to avoid pointers.
-
More ideas, polymorph methods for identified data types: Position pos=Vec3(0,0,1); Rotation rot=Vec3(80,0,0); cube.Set(pos); cube.Set(rot); cube.Add(pos); cube.Add(rot); cube.Subtract(pos); pos=cube.Get(); rot=cube.Get(); rot=cube.Get(POSITION); // forcing to get position data into Rotation object
-
Data protection is a non-existing issue in this case, since you can do the same with Set()/Get() anyway. And it really depends what attributes you expose as public, but position is not a very secret and vulnerable information. There's no need to be absolutarian when you can use common sense, and use whatever method is best in each situation Speed, easyness and effectiveness is everything here, since it's one of the most used commands. More ideas: cube.MoveZ(1); cube.GetZ(); cube.GetPositionZ(); // same as GetZ cube.MoveZ(1,1); // global cube.GetZ(1); // global cube.TurnZ(1); cube.RotateZ(); // not same as TurnZ, so perhaps confusing cube.SetRotationZ(); // more to write, but less to think since Set/Get // stands for absolute things cube.GetRotationZ(); cube.GetRotation().z; // also possible, but slower since // x and y is also returned by GetRotation()
-
Just brainstorming, all commands do the same thing, move a cube 1 unit forward. cube.Move(Vec3(0,0,1)); LE 0-2 way cube.Move(0,0,1); also LE 0-2 way, but not officially implemented (except in BlitzMax and Lua) cube.MoveForward(1); shorter to write, faster and more effective since x and y values don't need to be passed cube.MoveZ(1); very short, while still readable cube.position+=Vec3(0,0,1); interesting way also, since = and += operators can do seperate things like SetPosition and Move cube.position.z+=1; now i kinda start to like it, no need to create additional memory, just do it directly! and shortest to write too cube.globalposition.z+=1; same along the global Z direction
-
SetVertexColor() should be just as easy
-
The easiest way is just to modify the vertex positions of the mesh on the fly using the SetVertexPosition() command: http://www.leadwerks.com/wiki/index.php?title=Surfaces#SetVertexPosition I doubt it's needed to do it with a shader, but of course that might take less CPU and GPU power. Of course you could also just scale the mesh on the fly if you want to "raise" all vertices at the same time, but I think you want some custom deformation.
-
It's easy to get the exact mesh, face and 3D point which was picked with the mouse when you use EntityPick().
-
One idea what Leadwerks Engine could be, is also a fully working and tested interface and environment to write games. This environment would not only be technical tools, but also support. That's what CE3 does too, when you buy the engine, you buy people. You could use the same code and assets, and select on what platform and engine it runs. That's what bmx2 does too. Actually I had a similar issue earlier with LE 1.13, when I needed to use two versions of LE simultanously in the same game, it just swapped the exe when loading a scene which required either engine version. So you can even use multiple engines in the same game, but that's just a possibilty which should normally not be needed at all. Or who knows, one might need a space scene and a indoor scene in the same game, the possibilies are endless The cool thing would be, that you could write your game with all AAA assets and highest possible visual quality, and then choose as target platform for example HTC phone, and it would automatically profile and downgrade all the assets and settings you have.
-
You could say Leadwerks is also a friendly and helpful game development community. I haven't seen as family like forums anywhere else. And you get lots of useful ideas and assets from Leadwerks too.
-
You could rip the DrawCrossHair() function from gamelib: http://www.leadwerks.com/wiki/index.php?title=GameLib#DrawCrosshair It's not a image, but vector graphics, but that's in my opinion better since then it scales to all resolutions without quality loss.
-
Yes it does, and they already made a website where they collect signatures from people to pledge that Sony makes it real-free.
-
It's fake free. It's free only when you pay Sony unnecessary big amounts of money, I think like $5000. For that money you get a PS3 developer console, which is an actual hardware box with flashy lights.
-
I would love to try Phyre, but it needs PS3 developer license, which I don't want to pay. I would rather pay for free software, like Linux. I don't want to support big companies to make even more money, but give the money to the enthusiastic amateurs, speak indies, to whom it means much more. Heck, I love it when I can make someone happy with money only, so I already ordered from some indie modeller a well priced unit It feels good to pay for things when you know who gets it and that he really needs it.
-
Render to any graphics context to create Windowed applications and tools.
Canardia replied to isidisi's topic in Programming
You can use CreateCustomBuffer() to use an existing window: http://www.leadwerks.com/wiki/index.php?title=Buffers#CreateCustomBuffer Or you can make your own Windowed GUI in OpenGL. I would prefer own GUI, since then you are not dependant on the OS look, but can have your own look and feel, like in Blender or 3DSMax. -
Yeah, I can do it like that then.
-
If it was a Domino database, you could just make a local replica of it. But I think it's made with MySQL, so it's bit more difficult.
-
So why don't you use Phyre on XBOX then, and forget about its crappy SDK?
-
I think it's not even possible in C# to do procedural programming, since everything needs to be in a class. So it's also a bit like the Eiffel programming language. Of course you could put all LE commands into one huge class, but that might cause also problems if a class is too big, and it doesn't really bring any benefit either. So I think the C# headers should be like the LEO headers, since everyone who uses C# wants to use OOP too.
-
When will they make Phyre free also for non-PS3 developers? Can you make then PS3 and XBOX360 games with it, or do you still need some license from Sony and Microsoft?