Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2006
Offline Last Active Today, 06:49 AM

#5114262 Quaternions and matrices

Posted by on 04 December 2013 - 03:14 AM

It is possible to send a quaternion to a shader and use it directly. This may be useful for skinning or to reduce memory requirements. For example you can see this presentation by Crytek as an example of quaternion use in shaders.

#5110747 question about quadratic bezier patch

Posted by on 20 November 2013 - 07:12 AM

It is a point on a curve, but that curve does not belongs to the surface.. The blue curve in cadjunkie post is not contained in the surface. It is the set of the middle control points of the isoparametric curves.

#5110713 question about quadratic bezier patch

Posted by on 20 November 2013 - 03:02 AM

Drawing and intuition are often useful, but sometimes they are an obstacle in seeing the truth. I suggest to write the general equation of a surface Bézier patch and follows the advices we have already given. When you fix one of the two coordinates, the corresponding Bernstein polynomials becomes constants and you can rewrite the terms of the sums to get the equation of a Bézier curve. The control points of this new curve are simply obtained evaluating the curves I have written in my last post. C(P(1,0), P(1,1), P(1,2), 0.7) is not contained in the surface.

#5110503 question about quadratic bezier patch

Posted by 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 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 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 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 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 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 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 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 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 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 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 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.