Enable contrast version

# Tutor profile: Daniel D.

Inactive
Daniel D.
Video Game Developer tutoring gaming languages.
Tutor Satisfaction Guarantee

## Questions

### Subject:Computer Graphics

TutorMe
Question:

How can you tell if a rendered triangle is facing towards the camera, or away from the camera.

Inactive
Daniel D.
Answer:

If the triangle has a normal, a negative Z value in the normal, means it is facing away. If you only have the vertices of the triangle, then you can compute the normal. If the triangle has vertices A,B,C the normal is the cross product of the two vectors AB and AC.

### Subject:C Programming

TutorMe
Question:

What is the output on a 16 bit compiler? int a = 257; char *CharPtr = (char *)&a;; int *IntPtr = (int *) &b; a*=2; printf("%d %d,*IntPtr,CharPtr[1]); What if a was 258 at the first line instead?

Inactive
Daniel D.
Answer:

514 2 A times two, is 514, which is pointed to by IntPtr. CharPtr is only looking at one byte of the answer. 514 in Hex is 0x 0202. So one byte of that answer is 02. If a was 258, that is 0x102 times two, which is 0x204 in hex. This means that the low byte is 4, and the high byte is 2. So if its a little endian platform the answer would be 516 4 For a big endian platform, the answer is 516 2

### Subject:Assembly Language

TutorMe
Question:

When trying to optimize your assembly language program to run as fast as possible, what are some limiting factors to consider?

Inactive
Daniel D.
Answer:

First and foremost is optimizing for best cache utilization. Random memory accesses that cause your cache lines to get evicted, or written back are extremely latent, and can block execution of your thread. Secondly, unpredictable branches (branches that aren't loops), can cause your instruction pipeline to flush, and restart.

## Contact tutor

Send a message explaining your
needs and Daniel will reply soon.
Contact Daniel

## Request lesson

Ready now? Request a lesson.
Start Lesson

## FAQs

What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Lesson" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.
BEST IN CLASS SINCE 2015
TutorMe homepage
Made in California by Zovio
© 2013 - 2021 TutorMe, LLC
High Contrast Mode
On
Off