Search found 226 matches
- Sun Feb 15, 2015 7:31 pm
- Forum: Beginners Help
- Topic: Creating an inherited class from ITimer?
- Replies: 7
- Views: 911
Creating an inherited class from ITimer?
Hello all, This question is more a programming question regarding virtuals and inheriting from the ITimer class. Basically I already know that I can use the device to get the Itimer (e.g. device->getTimer()) but what I would like to understand is how to inherit from the ITimer class directly like th...
- Sun Jan 25, 2015 8:37 pm
- Forum: Advanced Help
- Topic: [SOLVED] quaternion 3rd person camera setTarget?
- Replies: 6
- Views: 2322
Re: quaternion 3rd person camera setTarget?
Why do you think it doesn't work? The trajectory from A to B or vector go straight from A to B is: A' = A + D*dt*(speed) which is a very simple problem. If you want to get the number of points until you reach B. Just divide TotalDistance/numofsegments = segment. Then just do A' = A + D*segment. The...
- Sat Jan 24, 2015 7:57 pm
- Forum: Advanced Help
- Topic: [SOLVED] quaternion 3rd person camera setTarget?
- Replies: 6
- Views: 2322
Re: quaternion 3rd person camera setTarget?
If you want to make the camera to focus from point A until B in 10 seconds. Just do it something like this. totalTime = 10; C = (B - A) TotalDistance = (C).getDistance D = Normalised(C) speed = Distance/totalTime You can assume dt to be delta time from last frame. Irrlicht already giving you that. ...
- Wed Jan 21, 2015 4:37 pm
- Forum: Advanced Help
- Topic: [SOLVED] quaternion 3rd person camera setTarget?
- Replies: 6
- Views: 2322
Re: quaternion 3rd person camera setTarget?
Ideally you don't need quaternion for that. Since you have target position vector A and B. The direction from A to B is C = B - A. Once you know the direction. All you have to do is normalise(C) = D. Then moving from A to B is. A' = A + D*dt*(speed) Then just do normal camera setTarget(A') Goodluck...
- Wed Jan 21, 2015 2:28 am
- Forum: Advanced Help
- Topic: [SOLVED] quaternion 3rd person camera setTarget?
- Replies: 6
- Views: 2322
[SOLVED] quaternion 3rd person camera setTarget?
Hello all, So far this is the question... and I'll try to explain this the best I can. Below I have a pic of the problem , the teal line is the camera. The red and black lines are the camera look at vectors (respectively the camera_vector_initial and camera_vector_final ). The obj_final is the black...
- Fri Nov 21, 2014 11:17 pm
- Forum: Advanced Help
- Topic: [Solved] polygon faces;single drawvertexprim call
- Replies: 7
- Views: 1271
Re: Add textures to polygon faces;single drawvertexprim call
No problem solved it.
- Thu Nov 13, 2014 7:55 pm
- Forum: Advanced Help
- Topic: [Solved] polygon faces;single drawvertexprim call
- Replies: 7
- Views: 1271
Re: Add textures to polygon faces;single drawvertexprim call
Custom primitive doesn't matter, the way you apply a shader is the same. Pseudocode: if (a) color = texture1; else color = texture2 Then you need to figure out how to pass the variable. I recommend the vertex alpha color, which you don't seem to use for anything else. Can't really give more specifi...
- Thu Nov 13, 2014 9:29 am
- Forum: Advanced Help
- Topic: [Solved] polygon faces;single drawvertexprim call
- Replies: 7
- Views: 1271
Re: Add textures to polygon faces;single drawvertexprim call
You will have to map such in the shader if you want one draw call with many different textures. Using glsl I assume; I thought that was only for shading but I guess textures fall into that category. Do you have any examples ( I have looked at the shading tutorial, but that doesn't address custom pr...
- Thu Nov 13, 2014 8:10 am
- Forum: Advanced Help
- Topic: [Solved] polygon faces;single drawvertexprim call
- Replies: 7
- Views: 1271
[Solved] polygon faces;single drawvertexprim call
I have the following code which initializes about 10k randomly placed polygons (square shaped faces) into a volume of space 200 irrlicht units cubed. What I was hoping to do is to try attaching various textures randomly (one texture per polygon face) and using a single drawvertexprimitivelist call t...
- Thu Nov 13, 2014 7:59 am
- Forum: Beginners Help
- Topic: [Solved]Irrlicht crashes at vertex array sized 65535?
- Replies: 17
- Views: 1399
Re: Irrlicht crashes at vertex array sized 65535?
Woah, that looks cool! I didn't even know what to expect when I ran it, but now I see sort of what you were doing :mrgreen: Thanks for fixing up some of the code for me, it's a bit clearer now. By the way, that first point about the camera was completely my mistake x)... I didn't see that it had an...
- Thu Nov 13, 2014 5:29 am
- Forum: Beginners Help
- Topic: [Solved]Irrlicht crashes at vertex array sized 65535?
- Replies: 17
- Views: 1399
Re: [solved] Irrlicht crashes at vertex array sized 65535?
Honestly, if you could comment your code a bit better, that would be great ;) However, here were some things I saw: * Camera position and target both set to 0? That's undefined behavior, I think. If you're not using the camera, just declare it with the default values. * Use the irrlicht logger, or ...
- Thu Nov 13, 2014 3:53 am
- Forum: Beginners Help
- Topic: [Solved]Irrlicht crashes at vertex array sized 65535?
- Replies: 17
- Views: 1399
Re: [solved] Irrlicht crashes at vertex array sized 65535?
There are six indices per four vertices. 25000*6/4 = 37500. Your index array can only hold 32767. (I don't know why you want to size it to 2^n -1; I guess you are confused between size of an array and largest index.) Oh. Sorry I counted wrong thanks for answering so quickly. By the way is there an ...
- Thu Nov 13, 2014 3:00 am
- Forum: Beginners Help
- Topic: [Solved]Irrlicht crashes at vertex array sized 65535?
- Replies: 17
- Views: 1399
Re: [solved] Irrlicht crashes at vertex array sized 65535?
Thanks guys so far... Now the drawvertexprimitivelist crashes for some reason. Also note the output where index_offset32852 vertex_count: -2142076847 Somehow the variable vertex_count is "garbaged" I can't see why though. Here's the code. It tries to draw 20k planes randomly spaced in 3d (...
- Thu Nov 13, 2014 12:53 am
- Forum: Beginners Help
- Topic: [Solved]Irrlicht crashes at vertex array sized 65535?
- Replies: 17
- Views: 1399
Re: [solved] Irrlicht crashes at vertex array sized 65535?
Good question, The limit is actually 4294967295, because you use a u32 to reference it in the function call. However, to have your indices access more than 65535 vertices, you must call the function with EIT_32BIT instead of EIT_16BIT. Note that this will also double the memory used for each index....
- Thu Nov 13, 2014 12:04 am
- Forum: Beginners Help
- Topic: [Solved]Irrlicht crashes at vertex array sized 65535?
- Replies: 17
- Views: 1399
Re: Irrlicht crashes at vertex array sized 65535?
Thanks a lot works now! On another note do you know the limit of indices array that I can pass into drawvertexprimitivelist? I'm assuming that too is 65535 but not sure. Anyways I'll mark this as solved, thanks for your help.