Search Results

Search found 18 results on 1 pages for 'nkint'.

Page 1/1 | 1 

  • Morph a sphere to a cube and a cube to a sphere with GLSL

    - by nkint
    I'm getting started with GLSL with quartz composer. I have a patch with a particle system in which each particle is mapped into a sphere with a blend value. With blend=0 particles are in random positions, blend=1 particles are in the sphere. The code is here: vec3 sphere(vec2 domain) { vec3 range; range.x = radius * cos(domain.y) * sin(domain.x); range.y = radius * sin(domain.y) * sin(domain.x); range.z = radius * cos(domain.x); return range; } // in main: vec2 p0 = gl_Vertex.xy * twopi; vec3 normal = sphere(p0);; vec3 r0 = radius * normal; vec3 vertex = r0; normal = normal * blend + gl_Normal * (1.0 - blend); vertex = vertex * blend + gl_Vertex.xyz * (1.0 - blend); I'd like the particle to be on a cube if blend=0 I've tried to find but I can't figure out some parametric equation for the cube. Maybe it is not the right way?

    Read the article

  • can't install with usb pen drive, SYSLINUX problem

    - by nkint
    i'm on ubuntustudio and i want to format my hd and try kubuntu (install in my acer notebook, no partion, no double operating system problem, only istall it) i've downloaded iso file ( kubuntu-10.10-desktop-i386.iso ), insert usb pen drive, then: system administration startup disk creator erased usb pen content, and "make startup disk" finally, reboot computer with pen inside usb port normal boot didn't start (as expected) but only black screen with this signal: SYSLINUX 4.03 2010-10-22 EDD Copyright (c) 1994-2010, H. Peter Anvin et al unknown keyword in configuration file boot: i've tried different usb pen stick and different iso files (ubuntu, kubuntu, netbook edition).. always same problem (sometimes only the first line without "unknow keyword in conf file" error) some advice?? sorry for my bad english

    Read the article

  • how to rename files with count

    - by nkint
    i have a directory like this: randomized_quad015.png randomized_quad030.png randomized_quad045.png randomized_quad060.png randomized_quad075.png randomized_quad090.png randomized_quad1005.png randomized_quad1020.png randomized_quad1035.png randomized_quad1050.png randomized_quad105.png randomized_quad1065.png randomized_quad1080.png randomized_quad1095.png randomized_quad1110.png randomized_quad1125.png randomized_quad1140.png and i want to rename the first files adding 0 in front of number, like: randomized_quad0015.png but i don't know how.. some help?

    Read the article

  • [JOGL] My program is too slow, how can I profile with Eclipse?

    - by nkint
    My simple opengl program is really toooo slow and not fluid. I'm rendering 30 sphere with simple illumination and simple materials. The only complex computing stuff I do is a collision detection between ray-mouse and spheres (that works ok and i do it only in mouseMoved) I'm not using any threads, just an animator to move spheres. How can I profile my jogl project? Or maybe (most probable...) I have some opengl instructions that I don't understand and make render particular accurate (or back face rendering that I don't need or whatever I don't know exactly I'm just entering the opengl world)

    Read the article

  • morph a sphere to a cube and a a cube to a sphere with GLSL

    - by nkint
    hi i'm getting started with glsl with quartz composer. i have a patch with a particle system in which each particle is mapped into a sphere with a blend value. with blend=0 particles are in random positions, blend=1 particles are in the sphere. the code is here: vec3 sphere(vec2 domain) { vec3 range; range.x = radius * cos(domain.y) * sin(domain.x); range.y = radius * sin(domain.y) * sin(domain.x); range.z = radius * cos(domain.x); return range; } // in main: normal = sphere(p0); * blend + gl_Normal * (1.0 - blend); i'd like the particle to be on a cube if blend=0 i've tried to find but i can't figure out some parametric equation for the cube. mayebe it is not the right way?

    Read the article

  • best way to compute vertex normals from a Triangle's list

    - by nkint
    hi i'm a complete newbie in computergraphics so sorry if it's a stupid answer. i'm trying to make a simple 3d engine from scratch, more for educational purpose than for real use. i have a Surface object with inside a Triangle's list. For now i compute normals inside Triangle class, in this way: triangle.computeFaceNormals() { Vec3D u = v1.sub(v3) Vec3D v = v1.sub(v2) Vec3D normal = Vec3D.cross(u,v) normal.normalized() this.n1 = this.n2 = this.n3 = normal } and when building surface: t = new Triangle(v1,v2,v3).computeFaceNormals() surface.addTriangle(t) and i think this is the best way to do that.. isn't it? now.. what about for vertex normals? i've found this simple algorithm: flipcode vertex normal but.. hei this algorithm has.. exponential complexity? (if my memory doesn't fail my computer science background..) (bytheway.. it has 3 nested loops.. i don't think it's the best way to do it..) any suggestion?

    Read the article

  • Metaphor for task synchronization [closed]

    - by nkint
    I'm looking for a metaphor. A friend of mine taught me to use metaphors from nature, everyday life, math, and use them to design my projects. They can help in creating a better design or better understanding or the problem, and they are cool. Now I'm working on a project with hardware and micro-controllers in C. For convenience, I have decided to use multiple micro-controllers as co-processor units for real-time (the slaves) and a master. This has saved me a lot of headache: I can code the main logic in the master without paying too much attention to super optimizing everything; I don't care if I need some blocking-call; I don't worry about serial communication with the computer. I just send messages to the slaves and they are super fast super in real time. I like my design and it seems to work well. So here are the important concepts that I'm trying capture in the metaphor: hierarchy of processing Not using one big brain but rather several small, distributed brain units using distributed power or resources I'm looking for a good metaphor for this concept of having one unit synchronize the work of all the others. Preferably, the metaphor would come from nature, biology, or zoology.

    Read the article

  • Calculate gears rotation for a realtime simulation

    - by nkint
    Hi I'm trying to do a game with real time simulations of gears. There is a big Gear with inside a smaller gear. I managed to draw gears with different diameters but equal size teeth, but if i try to move the smaller one inside the bigger one the movement is odd. see the animated gif. the biggest gear is in center C1 and the small in the center C2. I calculate C2 position in this way: C2.x = C1.x + C1_RADIUS-C2_RADIUS) * cos(t); C2.y = C1.y - C1_RADIUS-C2_RADIUS) * sin(t); for t that goes from 0 to TWO_PI in n steps. I apply as rotation the angle t, but maybe it is wrong and i have to calculate another rotation for get a perfect joint

    Read the article

  • Lighting with VBO

    - by nkint
    I'm using a Java JOGL wrapper called processing.org. I have coded some enviroment on it and I'm quite proud of it even if it has some ready stuffs that I didn't know anything about it (==LIGHTS). Then, for some geometry, I've decided to use a VBO. I had to pass in the hard way and recode all lights. But I can't achieve the same result. This is the original light system: And this with VBO: With this code: Vec3D l; gl.glEnable(GL.GL_LIGHTING); gl.glEnable(GL.GL_LIGHT0); gl.glEnable(GL.GL_COLOR_MATERIAL); gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, new float[]{0.8f,0f,0f}, 0); l = new Vec3D(0,0,-10); gl.glColor3f(0.8f,0f,0f); gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { l.x, l.y, l.z, 0 }, 0); gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPOT_DIRECTION, new float[] { 1, 1, 1, 1 }, 0); I can't achive the same light, the same color material, and the same wireframe stuffs. If needed I can also post the code I use for VBO, but it is quite standard vertex array grabbed on the net that uses glDrawArrays

    Read the article

  • [JOGL] my program is too slow, ho can i profile with Eclipse?

    - by nkint
    hi juys my simple opengl program is really toooo slow and not fluid i'm rendering 30 sphere with simple illumination and simple material. the only hard(?) computing stuffs i do is a collision detection between ray-mouse and spheres (that works ok and i do it only in mouseMoved) i have no thread only animator to move spheres how can i profile my jogl project? or mayebe (most probable..) i have some opengl instruction that i don't understand and make render particular accurate (or back face rendering that i don't need or whatever i don't know exctly i'm just entered in opengl world)

    Read the article

  • exact point oh a rotating sphere

    - by nkint
    I have a sphere that represents the heart textured with real pictures. It's rotating about the x axis, and when user click down it has to show me the exact place he clicked on. For example if he clicked on Singapore and the system should be able to: understand that user clicked on the sphere (OK, I'll do it with unProject) understand where user clicked on the sphere (ray-sphere collision?) and take into account the rotation transform sphere-coordinate to some coordinate system good for some web-api service ask to api (OK, this is the simpler thing for me ;-) some advice?

    Read the article

  • exact point on a rotating sphere

    - by nkint
    I have a sphere that represents the Earth textured with real pictures. It's rotating around the x axis, and when user click down it has to show me the exact place he clicked on. For example if he clicked on Singapore the system should be able to: understand that user clicked on the sphere (OK, I'll do it with unProject) understand where user clicked on the sphere (ray-sphere collision?) and take into account the rotation transform sphere-coordinate to some coordinate system good for some web-api service ask to api (OK, this is the simpler thing for me ;-) some advice?

    Read the article

  • how to deal with parallel programming

    - by nkint
    Hi. I know that parallel programming is a big resource in computer graphics, with moder machines, and mayebe a computing model that will be grow up in the near future (is this trend true?). I want to know what is the best way to deal with it. there is some practical general purpose usefulness in studying processor n-dimensional mesh, or bitonic sort in p-ram machines or it's only theory for domain specific hardware used in real particular signal elaborations of scientific simulations? Is this the best way to acquire the know how for how to become acquainted with cuda or opencl? (i'm interested in computer graphics applications) and why functional programming is so important to understand parallel computing? ps: as someone has advice me i have forked this discussion from http://stackoverflow.com/questions/4908677/how-to-deal-with-parallel-programming

    Read the article

  • The most efficent ways for drawing lines all day long with OpenGL

    - by nkint
    I'd like to put a computer screen that is running an OpenGL programs in a room. It has to run all day long (not in the night). I'd like to draw lines that are slowly fading in the background. The setting is simple: a uniform color background (say, black) and colored lines (say, white) that are slowly fading out. With slowly I mean.. hours. Say that the first line I draw is with alpha 255 (fully visible), after one hours is 240. After 10 hours is 105. One line could have 250 points and there will be like 300 line in one day. For now I have done a prototype with very rudimentary method like: glBegin( GL_LINE_STRIP ); iterator = point_list.begin(); for (++iterator, end = point_list.end(); iterator != end; ++iterator) { const Vec3D &v = *iterator; glVertex2f(v.x(), v.y()); } glEnd(); More efficient method?

    Read the article

  • Particle trajectory smoothing: where to do the simulation?

    - by nkint
    I have a particle system in which I have particles that are moving to a target and the new targets are received via network. The list of new target are some noisy coordinates of a moving target stored in the server that I want to smooth in the client. For doing the smoothing and the particle I wrote a simple particle engine with standard euler integration model. So, my pseudo code is something like that: # pseudo code class Particle: def update(): # do euler motion model integration: # if the distance to the target is more than a limit # add a new force to the accelleration # seeking the target, # and add the accelleration to velocity # and velocity to the position positionHistory.push_back(position); if history.length > historySize : history.pop_front() class ParticleEngine: particleById = dict() # an associative array # where the keys are the id # and particle istances are sotred as values # this method is called each time a new tcp packet is received and parsed def setNetTarget(int id, Vec2D new_target): particleById[id].setNewTarget(new_target) # this method is called each new frame def draw(): for p in particleById.values: p.update() beginVertex(LINE_STRIP) for v in p.positionHistory: vertex(v.x, v.y) endVertex() The new target that are arriving are noisy but setting some accelleration/velocity parameters let the particle to have a smoothed trajectories. But if a particle trajectory is a circle after a while the particle position converge to the center (a normal behaviour of euler integration model). So I decided to change the simulation and use some other interpolation (spline?) or smooth method (kalman filter?) between the targets. Something like: switch( INTERPOLATION_MODEL ): case EULER_MOTION: ... case HERMITE_INTERPOLATION: ... case SPLINE_INTERPOLATION: ... case KALMAN_FILTER_SMOOTHING: ... Now my question: where to write the motion simulation / trajectory interpolation? In the Particle? So I will have some Particle subclass like ParticleEuler, ParticleSpline, ParticleKalman, etc..? Or in the particle engine?

    Read the article

  • why specular light is not running?

    - by nkint
    hi, i'm on JOGL this is my method for lighting: private void lights(GL gl) { float[] LightPos = {0.0f, 0.0f, -1.0f, 1.0f}; float[] LightAmb = {0.2f, 0.2f, 0.2f, 1.0f}; float[] LightDif = {0.6f, 0.6f, 0.6f, 1.0f}; float[] LightSpc = {0.9f, 0.9f, 0.9f, 1.0f}; gl.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION, LightPos, 0); gl.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, LightAmb, 0); gl.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, LightDif, 0); gl.glLightfv(GL.GL_LIGHT1, GL.GL_SPECULAR, LightSpc, 0); gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, LightSpc, 0); gl.glEnable(GL.GL_LIGHT0); gl.glEnable(GL.GL_LIGHT1); gl.glShadeModel(GL.GL_SMOOTH); gl.glEnable(GL.GL_LIGHTING); } and i see my objects flat, no specular light.. any ideas? ps. to render my objects: gl.glColor3f(1f,0f,0f); gl.glBegin(GL.GL_TRIANGLES); for(Triangle t : tubeModel.getTriangles()) { gl.glVertex3f(t.v1.x, t.v1.y, t.v1.z); gl.glVertex3f(t.v2.x, t.v2.y, t.v2.z); gl.glVertex3f(t.v3.x, t.v3.y, t.v3.z); } gl.glEnd();

    Read the article

  • Remove duplicated images with the shell [duplicate]

    - by nkint
    This question is an exact duplicate of: Find all duplicate files by md5 hash 1 answer I have a folder with osme images. Each of them has a different name but some of them are duplicate. What is the best way to delete the duplicates? I have to do it sistematically so I need some shell command/script to invoke. No limitation of used software, just no strange software.. I'd like to do it both in a Mac and in a Ubuntu systems

    Read the article

  • export a JOGL applet and embedd into a html page

    - by nkint
    hi guys it is some time that i'm testing opengl with java and JOGL. now i have good result and i wanto to pubblish it on web. but i have some problem. i'm in eclipse, and i'm testing an Applet with JOGL. first of all i have this run time error (but the program works correctly): java.lang.IllegalArgumentException: adding a window to a container at java.awt.Container.checkNotAWindow(Container.java:431) at java.awt.Container.addImpl(Container.java:1039) at java.awt.Container.add(Container.java:365) at AppletHelloWorld.init(AppletHelloWorld.java:30) at sun.applet.AppletPanel.run(AppletPanel.java:424) at java.lang.Thread.run(Thread.java:619) then i found this incredibly clear page and i do what is said, i open html with the browser, the libs are downloaded but it stops at "Starting applet AppletHelloWorld" that is the name i gave to my applet. mayebe i miss something like main function or exporting well the jar? this is my main code: public class AppletHelloWorld extends Applet { public static void main(String[] args) { JFrame fr=new JFrame(); fr.setBounds(0,0,1015,600); fr.add(new AppletHelloWorld()); fr.setVisible(true); } public void init() { setLayout(null); MyJOGLProject canvas = new MyJOGLProject(); //MyJOGLProject extends JFrame canvas.run(); Container c = new Container(); c.add(canvas); add(c); } //....

    Read the article

1