# vamecum

Members

22

122 Neutral

• Rank
Member
1. ## constant speed moving on spline

I am sure this is really really simple, but still.. I have a tcb spline which has keyframes with a time value between 0(start) and 1(end). I can get a point on the spline with spline.getData(t). Now, I have an object which I want to move along the spline with constant speed. however, since the the spatial distance between two points is not relative to the time-frame between them, it's not that easy to do. 0 0.5 1.0 a---b----------------------c illustrated here, with a,b,c as keys and -'s representing spatial distance. the number is the key's time. now my current solution is to calculate the entire(spatial) length of the spline, and then calculate the spatial length from key 0 to key n and set that key's time to thisLength/TotalLength; Is there an easier way? Also currently, I'm not sure if this method is working correctly either, but it seems kind of close. I'm currently calculating spline length by step-throughing at small intervals and adding up deltas. if anyone know an analytic way of doing it, please let me know. I tried to look at arc length on wikipedia, but I'm not sure how to integrate the expression.
2. ## Futuristic racer

thanks for your input. Yes, the ray-firing approuch seems to be the easiest one and most common. for the rails of the track I envision using a sphere against a regular spline (tcb or catmull is the one's I've thought about). the track would of course need to be divided into zones. I'm not so sure that a whole octree is needed, but anyways some zoning mechanism to avoid checking all polygons all the time.
3. ## Futuristic racer

Hi! We're in the preproduction of our student project. A futuristic racer for next-generation embedded devices (GL ES 2.0) Our vehicles will be hover-cars like in f-zero or wipeout. that is, they will float above the tracks. The tracks is at the moment thought out to be a spline surface, at least when working with it in the track tool. so, the mathematics of a spline surface allows us to access it by (u,v) and get out a point, and get the tangent by derivation. The question is, is this feasible for automagic collision response? I imagine it being possible to move the car around the track by changing uv coords and use derivation to get a normal to the point the car is it, and use this normal to push the car above the track. And is there anyone who has an idea if this will be a better solution than a track with zones and a low polycount track and solving the problem with ray-to-polygon?
4. ## exporting from 3ds max through IGAME keyframe problem

Quote:Original post by hplus0603 It may be using keys other than keytype POS, perhaps? Did you evaluate all the different key types? Also, they just released version 2.2 of IGame -- it contains lots of bug fixes (including several annoying crashers); I highly recommend upgrading! You are completely right! After smacking my head realising how stupid I'd been not to just do a loop-querry of all types, I promptly did so. Revealing, the position controllers to be seperated into x,y,z channels. So now I know why I've been having problems. thanks a lot :)
5. ## exporting from 3ds max through IGAME keyframe problem

Hi! I'm doing an exporter using the IGame interface. The code is working allright in most respects, except exporting the keyframes. I seem to only get the objects keyframes through the quickSampleKey and/or sampleKey functions. When I ask for the keyframes directly like i.e int num=pGameContr->GetIGameKeyCount(IGAME_POS); it just returns 0. Have anyone else been annoyed with this problem and found a solution other than full-sampling? Hope some of you knows, looking forward to answers. (I use max 8 and max8 sdk)
6. ## Slime effect, anyone seen it done good?

Ury, Amazing thanks for pointing me towards that. The game looks cool, their slime seems to be in 2d though, so it's a bit easier to get to run in real-time.
7. ## Slime effect, anyone seen it done good?

The siggraphpaper looks amazing. getting it to run in realtime however, might be tricky. At least now I have somewhere to grab inspiration from :)
8. ## Slime effect, anyone seen it done good?

I am interested in if anyone has seen slime being done good. The effect I'm thinking of is sort of like this, you have an object, and then you get slimy stuff running down from it. kind of like this . http://bi0matrix.home.insightbb.com/slimeball.jpg What technique would be best to simulate/fake this? I'm thinking perhaps marching cubes or some implicit surface modelling like that, can be used to create good looking goo. Hope someone has thought of this effect, and has some inputs.
9. ## OpenGL exporting and displaying animation from 3ds max

Hi! I am creating a simple little scene-graph-like system and currently I'm at a test-phase where I'm trying to get it to playback some animation I've exported from 3ds max using the IGame interface. However, I've run into some major problems, and at the moment, I have no idea where they come from. is it the way IGame exports its data? , is it my code that's horribly wrong? I am not sure. Everynode in my scenegraph has a local-translation and a local 3x3 matrix for rotation , as well as world data for these. When I'm going down in my scenegraph, I do.. (*node)->update(t,*parent); which updates the data for that node. The update function looks like this. void Spatial::update(float t,Spatial *parent) { if(t>1.0) t=1; if(t<0) t=0; if(parent) { worldMatr = parent->worldMatr; if(this->localRot.isUsingController()) { //shouldn't we apply it to the worldTestThing as well? //localRot is a quaternion slerp controller worldMatr.rotate(localRot.getData(t)); } else worldMatr= worldMatr * localMatr; this->worldTrans = parent->worldTrans + parent->worldMatr*(this->localTrans.getData(t)); this->worldScale = parent->worldScale * this->localScale.getData(t); return; } //parent is zero, this is topnode, just do. worlMatr = localMatr; if(this->localRot.isUsingController()) { worldMatr.rotate(localRot.getData(t)); } this->worldTrans = this->localTrans.getData(t); this->worldScale = this->localScale.getData(t); } The result animation is just wrong. Anyone have ideas of what I might be doing wrong? or perhaps, it is something wrong with how I export the data.. (it's for opengl so I export it to column major order) outfile<<"Position:"<<node->GetLocalTM().GetRow(3).x<<" "<<node->GetLocalTM().GetRow(3).y<<" "<<node->GetLocalTM().GetRow(3).z<<std::endl; outfile<<"Rotation first colum:"<<node->GetLocalTM().GetRow(0).x<<" "<<node->GetLocalTM().GetRow(0).y<<" "<<node->GetLocalTM().GetRow(0).z<<std::endl; outfile<<"Rotation second colum:"<<node->GetLocalTM().GetRow(1).x<<" "<<node->GetLocalTM().GetRow(1).y<<" "<<node->GetLocalTM().GetRow(1).z<<std::endl; outfile<<"Rotation third colum:"<<node->GetLocalTM().GetRow(2).x<<" "<<node->GetLocalTM().GetRow(2).y<<" "<<node->GetLocalTM().GetRow(2).z<<std::endl; and the controllers. IGameControl *pGameContr=node->GetIGameControl(); if(pGameContr) { IGameKeyTab key; if(pGameContr->GetQuickSampledKeys(key,IGAME_ROT)) { if(key.Count()==0) outfile<<"RotationKeys:none"<<std::endl; else { outfile<<"RotationKeys:SlerpController"<<std::endl; outfile<<node->GetName()<<" animation"<<std::endl; outfile<<key.Count()<<" "; for(int i=0; i<key.Count(); i++) { outfile<<key[i].t/static_cast<float>(g_sceneTicks)<<" "; outfile<<key[i].sampleKey.qval.x<<" "<<key[i].sampleKey.qval.y<<" "<<key[i].sampleKey.qval.z<<" "<<key[i].sampleKey.qval.w<<std::endl; } } //pGameContr->GetIGameKeyCount(IGAME_POS)<<std::endl; }
10. ## Recursive rendering to texture (FBO)

http://img.photobucket.com/albums/v138/vamecum/reflectingThings2.jpg I'm gonna try and get the middle mirror to also reflect, and add in a ball drawed with cubemap reflection
11. ## Recursive rendering to texture (FBO)

Actually it was a bug with the stacking mechanism of FBO's. It's working now, except that there is some minor issues with with projection/viewport setup for the textures, but that'll be ironed out in a jiffy. Yes the paper is really interesting and I'm hoping to have it up and running tonight.
12. ## Recursive rendering to texture (FBO)

Hi! I'm trying to implement recursive planar reflections. http://wscg.zcu.cz/wscg2002/Papers_2002/E5.pdf In my rendering (drawScene), I render it recursivley when I find the object I'm rendering is a reflector. The problem with this, is that I don't seem to have found a nice way to "nest" rendering to texture calls. i.e rttBegin(0); rttBegin(1); rttEnd(1); rttEnd(0); What I'm doing at the moment, is stacking things. so that when rttBegin(1) is called, it stacks the framebuffer (each object has it's own framebuffer, depthbuffer and texture id), and when rttEnd(1) is called, it calls upon continueRtt(0), which enables object 0's framebuffer. My problem, of course, is that this does not seem to work. is there a nice way to do this? I would really appreciate some help as the democompo deadline is approaching. :) Thanks in advance! oh and why would I want to write code like this? beacuse I would like to do, rttBegin(0); rttBegin(1); rttEnd(1); rttBind(1); rttEnd(0); etc.
13. ## Real-time rendering book, collision detection problem.

I've decided to learn how to write code off tech-texts,articles and books. So by reading up on moving sphere-Polygon collision detection in the book, I went on to implement it. I've debugged it for sometime and I've discovered that it's likely that two, or at least one of the three tests involved have issues. The book? : http://www.realtimerendering.com/rtr2ed.jpg It seems that , sphere on plane?-> intersectionPoint inside polygon?-> return true; works The other two that I'm really wondering if is working correctly, is: moving sphere->polygon edge and moving sphere->polygon vertex. They seem to work most of the time, but most of the time is not all the time. So, I ask, is there anyone who have tried to implement their method described in the book, and implemented it successfully? I hope I could get some help :) Thank you!