•      Sign In
• Create Account

# sjhalayka

Member Since 10 Feb 2005
Offline Last Active Yesterday, 01:55 PM

### #5303843Xml Parser, C++

Posted by on 03 August 2016 - 01:36 PM

Anyone use RapidXML?

The first two responses to this thread cite RapidXML.

Thank you. My memory isn't so hot.

### #5303741Xml Parser, C++

Posted by on 02 August 2016 - 08:55 PM

Anyone use RapidXML?

### #5300625how rsa works on texts and signals?

Posted by on 13 July 2016 - 07:15 PM

If you really want to know how to encrypt large data like an audio clip, get the book called Applied Cryptography 20th Anniversary Edition.

In the book, it gives an example how to break up the message (the data converted to an integer) into tiny pieces (3 digits each) and encrypt the lot of them. Of course, larger pieces can be used so long as each piece is less than p*q, where p and q are large prime numbers.

### #5299702how rsa works on texts and signals?

Posted by on 07 July 2016 - 05:39 PM

See vector_of_bytes_to_biginteger() and biginteger_to_vector_of_bytes() in rsa.cpp... they convert a vector of ASCII chars to a single big integer, and back.

### #5277790Translate 2D mouse position to place an object in 3D space

Posted by on 23 February 2016 - 03:25 PM

Read: http://mathworld.wolfram.com/Tangent.html -- look for the big triangle. Remember SOHCAHTOA.

tan(theta), where theta = pi/8, gives you the rise over run. When the camera is 1 unit away from the origin, the run is 1. The rise goes on to give you half of the image plane width.

### #5277206Translate 2D mouse position to place an object in 3D space

Posted by on 20 February 2016 - 07:43 PM

Use printf or cout or NSLog or whatever to print out the values held by fx, fy, etc., to see what's going on during the calculations. Let me know how that goes.

### #5277004Translate 2D mouse position to place an object in 3D space

Posted by on 19 February 2016 - 11:56 AM

Thank you guys for your help!

I found the code on Stack Overflow a few months ago. If you like the code, then upvote me.

### #5277003Translate 2D mouse position to place an object in 3D space

Posted by on 19 February 2016 - 11:55 AM

Fun little snippet.

Many people try to turn a mouse's 2D position into a single location in a 3D world, forgetting that the projection results in a ray or a volume (the front of the volume is the area of a pixel).

Yeah, I use the concept of an image plane in my description of the code. Whether or not the code works for a raytracer is undecided as of yet.

### #5276952Translate 2D mouse position to place an object in 3D space

Posted by on 19 February 2016 - 09:14 AM

This code converts an x,y position into a 3D position (last_click_float_x, last_click_float_y). The eye position that I used is 0,0,1 and the image plane is at z = 0:

```    void touch_up_pos(int x, int y)
{
const float pi = 4.0f*atanf(1.0f);
const float aspect = (float)(m_renderbufferWidth) / (float)(m_renderbufferHeight);

const float fx = 2.0f * ((float)(x) / (float)(m_renderbufferWidth - 1)) - 1.0f;
const float fy = 2.0f * ((float)(y) / (float)(m_renderbufferHeight - 1)) - 1.0f;
const float y_fov = pi/4; // pi/4 radians = 45 degrees
const float tangent = tan(y_fov / 2.0f);
last_click_float_x = aspect * tangent* fx;
last_click_float_y = -tangent * fy;
last_click_float_z = 0;

// NSLog(@"touch up pos %f %f", last_click_float_x, last_click_float_y);
}
```

### #5272620Which quaternion fractals are your favourite?

Posted by on 25 January 2016 - 03:30 PM

Some quaternion fractals that I've discovered/made...

https://www.shapeways.com/designer/shawn_halayka

There is a call for Saskatchewan artists to design 10 art awards, and I'm thinking of submitting the fractals as potential awards.

Which ones do you like best? I've printed a few out in plastic, and my favourite is 'Flower'.

### #5271076Developing an Ocean Shader for Unreal Engine 4

Posted by on 14 January 2016 - 11:33 AM

That's awesome.

### #5267650S-hull

Posted by on 23 December 2015 - 08:44 AM

Networks are sometimes modeled by graph theory. One of the next steps is to put in a hopping entity that travels through the network (graph).

About those last 4 images:

Since the pointing outward value for all 4 solutions doesn't ever get to 0.5 and beyond (red lines don't ever become as prevalent as blue lines), the black hole's exterior network produces attraction via spatial curvature.

The average dot product value shows that the blue and red lines are almost always pointing nearly orthogonal to the corresponding outward pointing normals (not shown)... like there are layers of rotation.

The red lines along the black hole surface should actually be pointing inward when the black hole interior is modelled by a complete network (not shown). Ignore those red lines, they should be blue.

### #5263837Create a polygon from a texture (2d)

Posted by on 27 November 2015 - 09:40 AM

One way to do this is to use Marching Squares to convert a grayscale image into triangles.

http://www.gamedev.net/topic/624733-converting-a-bitmap-image-to-a-meshed-approximation/

### #5262484Works on AMD GPU in Windows, doesn't work on Intel GPU in Mac OS X

Posted by on 17 November 2015 - 04:38 PM

The problem was solved by adding GLUT_DEPTH to the glutInitDIsplayMode call. Thank you everyone for helping out! I should have figured that out sooner.

With detailed mesh:

### #5262468Works on AMD GPU in Windows, doesn't work on Intel GPU in Mac OS X

Posted by on 17 November 2015 - 03:23 PM

It also seems to me like a depth test precision issue, what can be aid by projection matrix. But back to original issue of not running on ios.

You might check theese things that are prone to errors between less flexible operation systems:

- back buffer and off screen render targets formats, as well resolutions

- ios, I have never coded for, can demand some sort of " frame draw enclosing", since ogl misses explicit presentation call, it can be some begin/end pair of entire gpu calls

cannot think of some other things to check.

Thanks for the ideas. I tried changing the near and far plane distances, but to no effect. I also switched to using glutSwapBuffers(), to no effect.

I also tried glFrontFace(GL_CCW) on the Mac to no effect -- will try it on the Windows machine later tonight.

PARTNERS