Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2006
Online Last Active Today, 08:05 AM

#5110503 question about quadratic bezier patch

Posted by apatriarca on 19 November 2013 - 10:51 AM

Let P(i, j) be the control points of the quadratic Bézier surface patches, C(P0, P1, P2, t) represents a quadratic Bézier curve with control points P0, P1 and P2 with parameter t and S(u, v) the quadratic Bézier surface patch equation. We are trying to explains to you that


S(u, 0.7) = C(   C(P(0,0), P(0, 1), P(0,2), 0.7)  ,   C(P(1,0), P(1, 1), P(1,2), 0.7)   ,   C(P(2,0), P(2, 1), P(2,2), 0.7)   , u).

#5110435 question about quadratic bezier patch

Posted by apatriarca on 19 November 2013 - 05:45 AM

That's latex code. It look like it is less readable than I assumed. I don't know how to write equations in this forum anymore (the eqn tag does not seem to work and I can't upload images from 3rd party services).


If you fix one of the two coordinates (for example v = 0.7 as in your example), the corresponding basis polynomials B_j(v) becomes constants. You can thus sum the terms P_ij B_j(v) for 0 <= j <= 2 to obtains the control points for a quadratic curve depending only on the parameter u.

#5110403 question about quadratic bezier patch

Posted by apatriarca on 19 November 2013 - 03:08 AM

The control points of the Bézier curve corresponding to a fix u or v coordinate can obtained by evaluating the three Bézier curves along the other direction at the fixed u or v coordinate. For example, let suppose you want to compute the Bézier curve at some fixed u. Your three control points are thus \sum_{i=0}^2 P_{i,0} B_i(u), \sum_{i=0}^2 P_{i,1} B_i(u), \sum_{i=0}^2 P_{i,2} B_i(u). The formulae for the other direction are analogous.

EDIT: Corrected some typos in formulae.

#5109399 Which is Best Zbrush or Blender?

Posted by apatriarca on 15 November 2013 - 04:42 AM

Blender and ZBrush are very different software packages. They are not, in my opinion, directly comparable and they are not the only available alternatives. What's your budget? Do you have some experience in one of those packages? Do you have any other artistic skill (for example sculpting or drawing or .. )?

#5104995 Array.Sort performance issue

Posted by apatriarca on 28 October 2013 - 04:30 AM

I never said disabling vsync solves the performance problem. I said that evaluating performance differences in frame per second with vsync is pointless. If you are really interested in evaluating the effect of some algorithm on performance you should disable vsync and start using better profiling methods and tools.

#5101530 lightuser data in Lua

Posted by apatriarca on 15 October 2013 - 07:29 AM

I'm not an expert of lua myself, but you can create tables called User and Logger (or something else) containing the methods you need and then write something like the following in your script:

function f(user, logger)

   User.setName(user, "name")
   User.setGroup(user, "group")

   Logger.output(logger, "User is set.")

This isn't really what you were asking, but I think the only way to associate methods to data exported to lua is to use full user data. You can't do it using lightdata.

#5098736 How do I use multithreading?

Posted by apatriarca on 04 October 2013 - 07:24 AM

I suggest using OpenMP or Intel TBB to add parallelism to your program. Working with thread and low-level synchronization primitives is hard if you do not understand what you are really doing and it is not very productive. It is very easy to implement data parallel programs using those libraries and it is not so easy to surpass their performance (particularly if you do not have much experience).

#5096079 Matrix storage layout and multiplication order woes

Posted by apatriarca on 23 September 2013 - 01:32 AM

I think your are mixing different concepts which should be separated. Column-major and row-major have nothing to do with the order of multiplication. They are simply different ways to store a matrix in memory. You can have column-major matrices and use row vectors or row-major matrices and use column vectors. The order of multiplication is given by the choice of row or column vectors. When you use column vectors you have to multiply the matrix on the left and then the transformations go from the right to the left. On the other hand, if you use row vectors, you have to multiply the matrix on the right and transformations go from left to right. So, in your case you have to compose the transformations as L*P while in OpenGL (and basically everywhere in mathematics) we usually do P*L. Have I misunderstood your post and your are already doing it?

#5095940 Should you work with limitations or overcome them?

Posted by apatriarca on 22 September 2013 - 08:27 AM

It does not make sense in my opinion to have some parts of the map with no tile and no logic. What about simply assume that a blank tile should be threaded as air? I actually also think spaces would be better than Xs to represent air since it woukd be easier to distinguish the other tiles.

#5095937 Matrix storage layout and multiplication order woes

Posted by apatriarca on 22 September 2013 - 08:10 AM

It is in my opinion easier to thing about this transformation orders if you also consider where the vector is multiplied and how it should be transformed. In your case you first want to apply the local transform and then move it using the parent transform. The correct transformation in your case is thus (v*L)*P and not (v*P)*L where v is the vector to transform, L is the local transformation and P the parent one.

#5094886 Is Win32 API sufficient to make a user interface like the latest Visual Studio

Posted by apatriarca on 18 September 2013 - 03:43 AM

As of QT, well, it is nice and cross-platform technology, tho if you want to see it in action, just look at the EA Origin desktop client - it is horrible and very laggy.


You shouldn't judge a framework like Qt by looking at one bad example. Qt has been successfully used in a lot of different software. Autodesk Maya interface use Qt for example. I have worked with both win32 and Qt and Qt is much better in my opinion..

#5081908 Techniques to avoid skinny triangles with constrained delaunay triangulation

Posted by apatriarca on 31 July 2013 - 06:13 AM

How big is your world? How big are the players and NPC? Do you really need this kind of optimization?

Are you implementing the constrained Delaunay triangulation yourself? If you do not want skinny triangles you have to introduce additional points and construct a conforming Delaunay triangulation. This means you also have to increase the triangle count relative to your constrained triangulation.

#5078935 Orbit (ellipse) collision detection between many many objects

Posted by apatriarca on 19 July 2013 - 09:17 AM

Two spheres moving on two elliptical orbits may collide even if the two orbits do not intersect. You thus have to somewhat compute the intersection of two tori (this is how mathematicians call donuts-like surfaces). Moreover, intersection "times" will be periodical and they will depend on the parametrization of both ellipses. It looks like you will have to maintain and work with a quite complicated data structure.

I think it is better to simply compute the intersections between the spheres (maybe using some kind of spatial acceleration structure or the GPU).

#5076345 Javascript's “Math.sin/Math.cos” and WebGL's “sin/cos” give different...

Posted by apatriarca on 09 July 2013 - 08:04 AM

Computing that number in Javascript on the CPU solves the problem only partially. At some point you may have problems using doubles too. Big numbers and trigonometric functions do not work really well together... Why are you using such formula to generate the points?

#5071070 "Soft" shader, or, how do I get this skin-lighting effect?

Posted by apatriarca on 19 June 2013 - 03:49 AM

All the examples except the cube men are in my opinion just faked rim lights. The basic idea is to add light in regions where the eye and surface normal are roughly perpendicular. The Unity example posted by TiagoCosta implement this technique. This technique does not simulate some kind of reflection but the effect of the back (or rim) light in the three point lighting system used in traditional art. I suggest learning about it. This kind of lighting is for example used to highlight the actors separating them from the background.