Search found 21 matches
- Thu Mar 01, 2012 3:14 am
- Forum: Advanced Help
- Topic: Texture coordinates in vertex shader
- Replies: 8
- Views: 1819
Re: Texture coordinates in vertex shader
That you read the rendertarget in that location in the fragment shader to create the effect of the refraction. Oh my god, I can't believe it was so simple... and here was I trying to make way more complicated calculations... thanks a lot Mel :D here's the final result: http://30.media.tumblr.com/tu...
- Wed Feb 29, 2012 5:05 pm
- Forum: Advanced Help
- Topic: Texture coordinates in vertex shader
- Replies: 8
- Views: 1819
Re: Texture coordinates in vertex shader
do just triplanar mapping but erase the code for side projection and keep just the code for the projection from "above". @REDDemon, that would be called "normal planar mapping", heh Isn't planar mapping fixed? Or should I use the camera position to and create new texture coordin...
- Wed Feb 29, 2012 1:40 am
- Forum: Advanced Help
- Topic: Texture coordinates in vertex shader
- Replies: 8
- Views: 1819
Texture coordinates in vertex shader
I'm trying to make a water shader for my scene. I would use one of the nodes that were posted but I need more freedom with my scene node. My initial idea was to use a render-to-texture and add a ripple effect on it to make it look like the water node is refracting whatever is behind it. The problem ...
- Sun Feb 12, 2012 5:30 pm
- Forum: Beginners Help
- Topic: When should I extend ISceneNode?
- Replies: 2
- Views: 393
When should I extend ISceneNode?
I was wondering, when should I extend ISceneNode (or IAnimatedMeshSceneNode or [...])? Only when I want a special rendering on my object? Or anytime I want a node to hold more information? Should my custom objects be just an object with a pointer to the node, or should they BE the node?
Thanks
Thanks
- Sat Feb 11, 2012 9:01 pm
- Forum: Beginners Help
- Topic: Erro in struct usage
- Replies: 12
- Views: 482
Re: Erro in struct usage
I'm not sure, I think in C, to instance a struct, you had to do a lot more than just "MyStruct struct" and giving it an alias made it easier. C++ probably keeps it for backwards compatibility. Again, I'm not really sure, could be for some other reason. edit: Now I'm feeling kinda dumb, I j...
- Sat Feb 11, 2012 8:36 pm
- Forum: Beginners Help
- Topic: Erro in struct usage
- Replies: 12
- Views: 482
Re: Erro in struct usage
No, that just creates an alias for your struct, so instead of using SMouseState varname; you use MouseState varname;
- Sat Feb 11, 2012 7:09 pm
- Forum: Beginners Help
- Topic: Vertex global position
- Replies: 12
- Views: 966
Re: Vertex global position
This actually works:
but I had to multiply the vertex position by the scale, like this:
Thanks for your time smso and hybrid
Code: Select all
(node->getPosition() + mb_vertices[41].Pos)
Code: Select all
(node->getPosition() + mb_vertices[41].Pos*10)
- Tue Feb 07, 2012 10:18 am
- Forum: Beginners Help
- Topic: Vertex global position
- Replies: 12
- Views: 966
Re: Vertex global position
I know how to position the hexes, what I'm trying to do is to merge the green area in them when they have neighbours
- Tue Feb 07, 2012 12:41 am
- Forum: Beginners Help
- Topic: Vertex global position
- Replies: 12
- Views: 966
Re: Vertex global position
I'm sorry for being so insistent, math is not my strongest point .-. how do I get the normal transformation matrix (and do I need the inverse or not?) this is what I tried: core::vector3d<f32> vertexPos = mb_vertices[41].Pos; core::CMatrix4<f32> matrix = node->getAbsoluteTransformation(); matrix.t...
- Mon Feb 06, 2012 11:02 am
- Forum: Beginners Help
- Topic: Vertex global position
- Replies: 12
- Views: 966
Re: Vertex global position
... If you want to move the hexagon nodes in gray color together, then core::vector3d green = (red1 + red2) * 0.5f; core::vector3d red1ToGreenVector = green - red1; ... Regards smso The problem with that is this: http://a1.sphotos.ak.fbcdn.net/hphotos-ak-ash4/419519_2714281412638_1125022233_3229775...
- Mon Feb 06, 2012 2:29 am
- Forum: Beginners Help
- Topic: Vertex global position
- Replies: 12
- Views: 966
Re: Vertex global position
Sorry, I was not clear enough. This is what I'm trying to do: http://a3.sphotos.ak.fbcdn.net/hphotos-ak-ash4/431147_2712621971153_1125022233_32297201_2002925347_n.jpg each hex is a node, the red dots are the vertices I have. I'm trying to find the green dot (the average position vector between the t...
- Sun Feb 05, 2012 6:01 pm
- Forum: Beginners Help
- Topic: Vertex global position
- Replies: 12
- Views: 966
Re: Vertex global position
Am I doing this right? (and what is this supposed to do?) core::CMatrix4<f32> mat = node->getAbsoluteTransformation(); mat = mat.getInverse(mat); mat.transformVect(mb_vertices[41].Pos); and after that, how do I find the average point between the two vertices and the average point local position ...
- Sun Feb 05, 2012 3:08 pm
- Forum: Beginners Help
- Topic: Vertex global position
- Replies: 12
- Views: 966
Vertex global position
I'm having trouble with vertices position in my scene. I have 2 different nodes (and meshes) and I want to change the position of a single vertex on both nodes to make then ocupy the same place in the global 3D space. The problem is, the vertex position in the mesh buffer is local based on the node ...
- Wed May 11, 2011 3:10 am
- Forum: Beginners Help
- Topic: Updating the Bounding Box
- Replies: 6
- Views: 1163
yay I fixed
Code: Select all
note->getMesh()->getMeshBuffer(0)->recalculateBoundingBox();
core::aabbox3df box = node->getMesh()->getMeshBuffer(0)->getBoundingBox();
node->getMesh()->getMesh(0)->setBoundingBox(box);
- Tue May 10, 2011 3:23 pm
- Forum: Beginners Help
- Topic: Updating the Bounding Box
- Replies: 6
- Views: 1163
have you tried.... meshBuffer->recalculateBoundingBox (); That did update the bounding box, but only the pink one (from setDebugDataVisible(scene::EDS_BBOX_ALL); ), I'm guessing the selector uses the white one since the selection is still based on the old bounding box. Hm, only bounding-box updates...